summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* command: add git hashes for some GPL-only partswm42017-06-231-0/+2
| | | | For context.
* player: disable video equalizer frontend code for WIP LGPL modewm42017-06-231-0/+4
| | | | | | | | | | Nick and kiriuja could not be reached, and created/changed this in 92c5c274, 6441a5ad, bffd4007, 555c6766, c2c997fd. The video equalizer stuff was redone fully later, but there are still parts that look too similar and basically use the same approach. I'm more comfortable with declaring it GPL only for now. I plan to redo them later in a way that will remove copyright.
* player: disable deinterlace property for WIP LGPL modewm42017-06-231-0/+5
| | | | | | cehoyos has not agreed to the LGPL relicensing. He added the deinterlace property in commit 7b25afd7. Make it GPL-only for now. The still working parts of the --deinterlace option are not affected by his copyright.
* player: disable --priority for WIP LGPL modewm42017-06-231-1/+1
| | | | | Due to commit 14ecebe9: author could not be reached. I don't think anything copyrightable is left, but to be sure make it GPL-only.
* player: deprecate "osd" commandwm42017-06-231-0/+6
| | | | | | | | | | | It was extended by "seru" in 8d190244. This person could not be reached (or does not reply), and it's in the way of LGPL relicensing. Deprecate it, and mark the (probably) affected parts of the code with HAVE_GPL. To be fair, even though the osd.c parts were refactored from the original code, there's probably no copyright by seru on it. But for now play it save. The mere existence of a 3rd OSD level is certainly not copyrightable, so you still can set osd-level to 3 - just that it does nothing.
* demux: replace custom return codes with CONTROL_ oneswm42017-06-191-2/+2
| | | | | | | | This is more uniform, and potentially gets rid of some past copyrights. It might be that this subtly changes caching behavior (it seems before this, it synced to the demuxer if the length was unknown, which is not what we want.)
* input: change license to LGPLwm42017-06-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cehoyos adds the step_property command in 7a71da01d, and it could be argued that copyright of this still applies to the later add/cycle commands (a668ae0ff90c4). While I'm not sure if this is really the case, stay conservative for now and mark these commands as GPL-only. Mark the command.c code too, although that is not being relicensed yet. I'm leaving the MP_CMD_* enum items, as they are obviously different. In commit 116ca0c7682, "veal" (essentially an anonymous author) adds an "osd_show_property_text" command (well, the commit message says "based on" that person's code, so it's not clear how much is from him or from albeu, who agreed to LGPL). This was later merged again with the "osd_show_text" command, and then all original code was removed in commit 58cc0f637f, so I claim that no copyright applies anymore. (Though technically the input.conf addition still might be copyrighted, so I'm just dropping it to get rid of the thought.) "kiriuja" added 2f376d1b39 (sub_load etc.) and be54f4813 (switch_audio). The latter is gone. I would argue that the former is fully rewritten with commits b7052b431c9 and 0f155921b0. But like in the step_property case, I will be overly conservative for now, and mark them as GPL-only, as this is potentially shaky and should be thought through first. (Not bothering with the command define/enum in the header, as it will be unused in LGPL mode anyway.) keycodes.c/h can be GPL, except for commit 2b1f95dcc2f8, which is a patch by someone who wasn't asked yet. Before doing something radical, I will wait for a reply.
* vo_opengl: implement support for OOTFs and non-display referred contentNiklas Haas2017-06-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces (yet another..) mp_colorspace members, an enum `light` (for lack of a better name) which basically tells us whether we're dealing with scene-referred or display-referred light, but also a bit more metadata (in which way is the scene-referred light expected to be mapped to the display?). The addition of this parameter accomplishes two goals: 1. Allows us to actually support HLG more-or-less correctly[1] 2. Allows people playing back direct “camera” content (e.g. v-log or s-log2) to treat it as scene-referred instead of display-referred [1] Even better would be to use the display-referred OOTF instead of the idealized OOTF, but this would require either native HLG support in LittleCMS (unlikely) or more communication between lcms.c and video_shaders.c than I'm remotely comfortable with That being said, in principle we could switch our usage of the BT.1886 EOTF to the BT.709 OETF instead and treat BT.709 content as being scene-referred under application of the 709+1886 OOTF; which moves that particular conversion from the 3dlut to the shader code; but also allows a) users like UliZappe to turn it off and b) supporting the full HLG OOTF in the same framework. But I think I prefer things as they are right now.
* video: refactor HDR implementationNiklas Haas2017-06-181-1/+0
| | | | | | | | | | | | | | | List of changes: 1. Kill nom_peak, since it's a pointless non-field that stores nothing of value and is _always_ derived from ref_white anyway. 2. Kill ref_white/--target-brightness, because the only case it really existed for (PQ) actually doesn't need to be this general: According to ITU-R BT.2100, PQ *always* assumes a reference monitor with a white point of 100 cd/m². 3. Improve documentation and comments surrounding this stuff. 4. Clean up some of the code in general. Move stuff where it belongs.
* command: avoid going through prop->opt bridge from opt->prop bridgewm42017-06-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | The option->property bridge can't (and shouldn't) preserve option flags. This is a problem if the flags are actually used by the option implementation, beyond calling m_config_mark_co_flags(). This was true so far, but b8193e40719 changed this. Now setting the --profile option (usually from a config file or as recursive profile) can have side-effects that depend on the flags contents. Solve this by avoiding going through the "double bridge" altogether. This fixes a regression if an auto-profile is active, and the user specifies an option on the command line that is supposed to override an item in a profile recursively referenced by the auto-profile. The command line option will not override it, because the auto-profile is set later, and during application of the auto-profile, the M_SETOPT_PRESERVE_CMDLINE flag gets lost. Having to add something to m_property is not nice, and I'll probbaly regret later. On the other hand, there is a chance that this helps towards true option/property unification.
* command: add all options to property->option bridgewm42017-06-151-13/+13
| | | | | | | | | | | | | | | | Before this, options with co->data==NULL (i.e. no storage) were not added to the bridge (except alias options). There are a few options which might make sense to allow via the bridge ("profile" and "include"). So allow them. In command_init(), we merely remove the co->data check, the rest of the diff is due to switching the if/else branches for convenience. We also must explicitly error on M_PROPERTY_GET if co->data==NULL. All other cases check it in some way. Explicitly exclude options from the property bridge, which would be added due this, and the result would be pointless.
* options: fix some missing --sub-ass-style-override renameswm42017-06-071-1/+1
| | | | | The option was renamed not to include "-style", but not all uses were updated.
* command: use scale_units to add/cycle integer propertiesJames Ross-Gowan2017-05-121-16/+38
| | | | | | | | | | | | | | | This adds check_property_scalable, which returns true if the property is backed by a floating-point number. When the add or cycle commands operate on these properties, they can benefit from the fractional scale value in cmd->scale. When the property is not backed by a floating-point number, cmd->scale_units is used instead, so for axis events, the property is only incrmented when the user scrolls one full unit. This solution isn't perfect, because in some cases integer-backed properties could benefit from accurate scrolling. For example, if an axis is bound to "cycle audio 5", the cycle command could be made to change the audio track by one when the user scrolls 1/5th of a unit, though this behaviour would require more changes to the options system.
* audio: move replaygain control to top-level optionswm42017-04-261-4/+4
| | | | | | | | | | | | | | | | | | | | | af_volume is deprecated, and so are its replaygain sub-options. To make it possible to use replaygain without deprecated options (and of course to make it available at all after af_volume is dropped), reintroduce them as top-level options. This also means that they are easily changeable at runtime by using them as properties. Change the "volume" property to use the new update mechanism as well. We don't actually bother sharing the implementation between new and deprecated mechanisms, as the deprecated one will simply be deleted. For the from_dB() functions, we mention anders' copyright, although I'm not sure if a mere formula is copyrightable. This will have to be determined later. This whole change is mostly untested. Our distributed human CI will take care of it.
* player: fix core-idle and eof-reached update notifcationswm42017-04-141-4/+4
| | | | | | | | Make mpv_observe_property() work correctly on them even with --keep-open-pause=no. This also changes the situations in which the screensaver is enabled/disabled subtly.
* player: unmess pause state handlingwm42017-04-141-7/+3
| | | | | | | | | Merge the pause_player() and unpause_player() functions. Make sure the pause events are emitted properly. We can now set the internal pause state based on a predicate, instead of e.g. handle_pause_on_low_cache() making a mess to trigger the internal pause state as wanted. Preparation for some more changes.
* command, manpage: some leftover mentions of renamed --loop optionwm42017-04-111-1/+1
|
* command: update sub-fps etc. options on runtime changeswm42017-04-101-11/+7
| | | | | | | | | | | | | Un-special-case the sub-speed property, and apply subtitle speed updates in more cases. In particular, this respects runtime changes of the sub-fps option. (A minor consequence of this is that the subtitle speed is recomputed more often even in cases when it's not necessary. Also, the subtitle update is slightly "delayed" rather than strictly instant. Both of these likely are absolutely not observable by the user, although the subtitle speed verbose log message will be printed more often if the subtitle format is MicroDVD.)
* player: make screenshot commands honor the async flagwm42017-04-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | And also change input.conf to make all screenshots async. (Except the every-frame mode, which always uses synchronous mode and ignores the flag.) By default, the "screenshot" command is still asynchronous, because scripts etc. might depend on this behavior. This is only partially async. The code for determining the filename is still always run synchronously. Only encoding the screenshot and writing it to disk is asynchronous. We explicitly document the exact behavior as undefined, so it can be changed any time. Some of this is a bit messy, because I wanted to avoid duplicating the message display code between sync and async mode. In async mode, this is called from a worker thread, which is not safe because showing a message accesses the thread-unsafe OSD code. So the core has to be locked during this, which implies accessing the core and all that. So the code has weird locking calls, and we need to do core destruction in a more "controlled" manner (thus the outstanding_async field). (What I'd really want would be the OSD simply showing log messages instead.) This is pretty untested, so expect bugs. Fixes #4250.
* command: add property notifications for hwdec propertieswm42017-03-311-3/+3
| | | | | | | | | | This is a bit approximate, because we rely on the pixel format changing if the hardware decoding changes. This is not always true, as the pixel format for software decoded video and hardware decoded video copied back to CPU RAM could be the same. (Not sure if that is actually the case for any supported cases.) But for now this should fix most of #4289.
* command: add expand-text command to property-expand a stringAvi Halachmi (:avih)2017-03-261-0/+10
|
* command: add better runtime filter toggling methodwm42017-03-251-1/+4
| | | | | | | | | | Basically, see the example in input.rst. This is better than the "old" vf-toggle method, because it doesn't require the user to duplicate the filter string in mpv.conf and input.conf. Some aspects of this changes are untested, so enjoy your alpha testing.
* command: add demux-start-time propertyMatthias Hunstock2017-03-251-0/+11
| | | | Add a demux_start_time property, update docs.
* command: add a property to signal whether networking is usedwm42017-03-241-0/+12
| | | | | | Requested. The property semantics are a bit muddy due to lack of effort. Anticipated use is different display of cache status, so it should not matter anyway.
* command: add a redundant NULL checkwm42017-02-201-1/+1
| | | | | | | | | Currently, tracks have always associated streams, so there can't be a NULL dereference on the next line. But all the code is written with the possibility in mind that we might want tracks without streams, so make it consistent. Found by coverity.
* command: fix wrong sizeof() argumentwm42017-02-201-1/+1
| | | | | | | Found by coverity. All of these cases happened to work, probably even in 32 bit (when the name pointer allowed it to use only 4 bytes of space).
* player: add experimental stream recording featurewm42017-02-071-0/+22
| | | | | This is basically a WIP, but it can't remain in a branch forever. A warning is print when using it as it's still a bit "shaky".
* command: nicer OSd-formatting for loop-filewm42017-01-311-0/+1
|
* win32: snap to screen edgespavelxdd2017-01-271-0/+1
| | | | | | | Disabled by default. The snap sensitivity value depends on the screen DPI. The default value is 16px on a 96 DPI screen. Fixes #2248
* command: shorten long playlists on OSDwm42017-01-261-4/+77
| | | | | | | | | | | | A hacky, convoluted, half-working mess that attempts to cut off overlong playlists. It does so by relying on the ASS formatting rule that the font size is specified in the virtual PlayResY resolution. This means we can (normally) easily tell how many lines fit on the screen. On the other hand, this does not work if the text is wrapped. This as a kludge until a Better™ solution is available.
* command: fix potential crash for script-binding with multi-commandswm42017-01-241-1/+2
| | | | | | | | "show-text test; script-binding display_stats" can potentially crash. It sends a message event. None of the string arguments can be NULL, which fails if cmd->key_name is NULL. This in turn can be due to commands combined with ";" (basically the key association doesn't consider nested commands).
* player: remove --stream-capture option/propertywm42017-01-211-24/+0
| | | | | | | | | | | | | | | This was excessively useless, and I want my time back that was needed to explain users why they don't want to use it. It captured the byte stream only, and even for types of streams it was designed for (like transport streams), it was rather questionable. As part of the removal, un-inline demux_run_on_thread() (which has only 1 call-site now), and sort of reimplement --stream-dump to write the data directly instead of using the removed capture code. (--stream-dump is also very useless, and I struggled coming up with an explanation for it in the manpage.)
* command: rename framedrop propertieswm42017-01-201-6/+10
| | | | | | | | | | "drop-frame-count" -> "decoder-frame-drop-count" "vo-drop-frame-count" -> "frame-drop-count" This gets rid of the backwards "drop-frame" part in the name. Maybe calling the new property "frame-drops" would be better, but there are already a bunch of similar properties that end in "-count".
* player: add prefetching of the next playlist entrywm42017-01-181-1/+1
| | | | | | | | | | | | Since for mpv CLI, the player state is a singleton, full prefetching is a bit tricky. We do it only on the demuxer layer. The implementation reuses the old "open thread". This means there is significant potential for regressions even if the new option is not used. This is made worse by the fact that I barely tested this code. The generic mpctx_run_reentrant() wrapper is also removed - this was its only user, and its remains become part of the new implementation.
* command: remove worthless error handling codewm42017-01-091-6/+5
| | | | | | The property calls will always succeed anyway. On the other hand, the error handling is kind of incomplete (doesn't check setting ab-loop-a when ab-loop-b is also set), so drop this code.
* player: remove dysfunctional edition switching OSD codewm42017-01-051-1/+0
| | | | | | | | | | | | | Was intended to show a "nice" message on edition switching. In practice, the message was never visible. The OSD code checks whether a demuxer is loaded, and if not, discards the message - meaning if the OSD code happened to run before the demuxer was fully loaded, no message was shown. This is apparently a regression due to extensions to the OSD and the situations in which it can be used. Remove the broken code since it's too annoying to fix. Instead, a default property message will be shown, which is a bit uglier, but actually not too unuseful.
* Remove compatibility thingswm42016-12-071-4/+0
| | | | | | Possible with bumped FFmpeg/Libav. These are just the simple cases.
* options: some simplificationswm42016-11-291-2/+1
| | | | | | | | Remove more stuff that was needed only for legacy suboptions. One user-visible change is that parent-options like --tv are now not visible anymore. They lead to a special error message when used before, but now they're simply not part of the option list anymore.
* command: warn against deprecated properties in all caseswm42016-11-231-13/+9
| | | | | | | | | For some reason, some types of accesses didn't warn, for example when using mp.observe_property() in Lua. This was because the deprecation handling code explicitly checks certain accesses. I'm not quite certain why it was done this way. Just make it warn always. This could be backported to the current release, if we cared.
* command: redefine some deprecated propertieswm42016-11-221-37/+0
| | | | | | | | | | | | | | As threatened by the API changes document. We can actually keep the deprecated --playlist-pos and --cache options, since they are aliases and not used by the corresponding properties. They are inconsistent, but do no harm. Keep them for now for the sake of the command line user. mpv_identify.sh partially stopped working, because it was never updated. The shell magic can't deal with property names that contain "/", so we can't replace "samplerate" with "audio-params/samplerate" - just remove these properties. (How about you use ffprobe?)
* player: removing last playlist entry while looping should not stopwm42016-11-181-1/+1
| | | | | | | Run "playlist-remove current" while the last playlist entry is being played stopped playback. Fix this and return to the first entry instead. Fixes #3808.
* command: if window-scale can't be set properly, set it as optionwm42016-10-251-13/+8
| | | | Kind of sketchy, but happens to fix #3724.
* command: silence deprecation warnings with --reset-on-next-file=allwm42016-10-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | --reset-on-next-file=all triggers m_config_backup_all_opts(), which backups all options (even deprecated ones). Later, when the option values are reset with m_config_restore_backups(), mp_on_set_option() is called, which in turn calls mp_property_do_silent(), which in turn will call mp_property_generic_option() and m_config_get_co(), which triggers the deprecation message. Unfortunately there's no good way to determine whether an option has actually changed (there's no option value compare operation), so the deprecated options have to be set no matter what. On the other hand, we can't pass through additional flags through the property layer. So we add a dumb global flag to silence the deprecation warnings in these cases. Fortunately m_config_get_co_raw() works to silence the warnings. m_config_get_co() also resolves aliases (deprecated and non-deprecated), but aliased options are handled differently by the option-property bridge, so we don't need to do that here, so the only purpose of it is to trigger a warning for deprecated (non-alias) options.
* command: fix reset-on-next-file=all and tv-freq optionwm42016-10-221-1/+2
| | | | | | | | The tv-freq options and properties use different types, thus must be treated as incompatible. Fixes an assertion with reset-on-next-file=all, which tries to set the option. Fixes #3708.
* options: handle --audio-device changes like the other optionswm42016-10-051-4/+1
| | | | | | Don't require special property code for handling updates, and simply use the UPDATE_AUDIO flag instead. Also make runtime changes to --audio-client-name take effect.
* audio: move some fallback handling to common AO reload functionwm42016-10-051-15/+2
| | | | | | | | | Now a reload requested by an AO behaves in exactly the same way as changing an AO-related options (like --audio-channels or --audio-exclusive). This is good for testing and uniform behavior. (You could go as far as saying it's a necessity, because the spotty and obscure AO reload behavior is hard to reproduce and thus hard to test at all.)
* command: flush and uninitialize audio output first on option changeswm42016-10-051-1/+3
| | | | | | | | | | | | This affects changing audio configuration options. Explicitly flush and uninitialize the audio output first before doing the rest. This should ensure all state attached to the audio output is discarded and not used during the reconfiguration. Also add a comment to the reinit_audio_filters() call. It doesn't necessarily restore the audio chain fully, but makes sure a seek is issued if the amnount of buffered audio discarded was huge enough to cause "problems".
* command: include deprecated/aliased options in property bridgewm42016-10-041-18/+28
| | | | | | | | If we really want client API users to use mpv_set_property() instead of mpv_set_option(), then compatibility handling of deprecated options should be included. Otherwise, there's the danger that client API users either break too early (and without a warning), or mpv_set_option() will continue to have a reason to exist.
* player: fix previous commitwm42016-10-031-2/+7
| | | | ...
* command: allow absolute seeks relative to end of streamPhilip Sequeira2016-10-021-0/+9
| | | | | | "seek -10 absolute" will seek to 10 seconds before the end. This more or less matches the --start option and negative seeks were otherwise useless (they just clipped to 0).
* player: make --stop-screensaver runtime-changeablewm42016-10-021-0/+3
| | | | |