summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
...
* options: take care of propertly updating options on runtime changeswm42016-09-171-3/+71
| | | | | | | | | | | | | | | | | | | | | | All option write accesses are now put through the property interface, which means runtime option value verification and runtime updates are applied. This is done even for command line arguments and config files. This has many subtle and not-so-subtle consequences. The potential for unintended and intended subtle or not-subtle behavior changes is very large. Architecturally, this is us literally jumping through hoops. It really should work the other way around, with options being able to have callbacks for value verification and applying runtime updates. But this would require rewriting the entirety of command.c. This change is more practical, and if anything will at least allow incremental changes. Some options are too incompatible for this to work - these are excluded with an explicit blacklist. This change fixes many issues caused by the mismatch between properties and options. For example, this fixes #3281.
* command: make window-scale redirect to option if no window createdwm42016-09-171-1/+1
| | | | For consistency with other properties that mirror options.
* player: fix a missed wakeupwm42016-09-161-0/+1
| | | | | ytdl.lua stopped working after commit 8716c2e8, because finishing the hook did not wakeup the playloop correctly.
* player: litter code with explicit wakeup callswm42016-09-161-1/+19
| | | | | | | | | | | | | This does 3 kinds of changes: - change sleeptime=x to mp_set_timeout() - change sleeptime=0 to mp_wakeup_core() calls (to be more explicit) - change commands etc. to call mp_wakeup_core() if they do changes that require the playloop to be rerun This is preparation for the following changes. The goal is to process client API requests without having to rerun the playloop every time. As of this commit, the changes should not change behavior. In particular, the playloop is still implicitly woken up on every command.
* player, ao, vo: don't call mp_input_wakeup() directlywm42016-09-161-7/+15
| | | | | | | | | | | | | Currently, calling mp_input_wakeup() will wake up the core thread (also called the playloop). This seems odd, but currently the core indeed calls mp_input_wait() when it has nothing more to do. It's done this way because MPlayer used input_ctx as central "mainloop". This is probably going to change. Remove direct calls to this function, and replace it with mp_wakeup_core() calls. ao and vo are changed to use opaque callbacks and not use input_ctx for this purpose. Other code already uses opaque callbacks, or has legitimate reasons to use input_ctx directly (such as sending actual user input).
* osd: slightly simplify update logicwm42016-09-151-2/+2
| | | | | | | | | | | | | | | | Remove the per-part force_redraw flags, and instead make the difference between flagging dirty state and returning it to the player frontend more explicit. The big issue is that 1. the OSD needs to know the dirty state, and it should be cleared strictly when it is re-rendered (force_redraw flag), and 2. the player core needs to be notified once, and the notification must be reset (want_redraw flag). The call in loadfile.c is replaced by making osd_set_sub() set the change flag. Increasing the change flag on dirty state (the force_redraw check in render_object()) should not be needed, because OSD part renderers set it correctly (at least now). Doing this just because someone pointed this out.
* player: Improve OSD formatting of sub-speed optionVladimir Panteleev2016-09-131-0/+4
|
* player: Apply new sub-speed values during playbackVladimir Panteleev2016-09-131-0/+21
|
* command: don't log "ignore" command with -v verbositywm42016-09-111-1/+2
| | | | | It's damn annoying because the mouse move input event is mapped to this by default.
* command: do not call mp_switch_track() before proper initializationwm42016-09-101-7/+17
| | | | | | | | | | | This is an awful corner-case party, because we've started to allow the user to send track-switching related commands before stream selection is done in the loading stage. If mp_switch_track() is called before this stream selection, it can behave inconsistently. So if we're in the pre-loading phase, we must set the stream selection options to get streams selected later, instead of calling this function. There seem to be some annoying circumstances that exclude mp_switch_track() from handling this logic too, so do it at all call-sites.
* vo: don't access global options unsynchronizedwm42016-09-081-0/+11
| | | | | And since there's no proper fine-grained option change notification mechanism yet, intercept updates to "framedrop" manually.
* command: try selecting the next track if track switching failswm42016-09-031-3/+4
| | | | | | | | | | | | This affects the "cycle" command. If we switched to the next track, and it failed to initialize, we just deselected everything. Change it so that if initialization fails early (typically decoder selection), we try to continue with the track after that. (Even if nothing can be selected, the loop will terminate when trying to select nothing. Fixes #3446.
* command: remove vo-cmdlinewm42016-09-021-13/+0
| | | | | | With the recent vo_opengl changes it doesn't do anything anymore. I don't think a deprecation period is necessary, because the command was always marked as experimental.
* vo_opengl: deprecate sub-options, add them as global optionswm42016-09-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | vo_opengl sub-option were always rather annoying to handle. It seems better to make them global options instead. This is simpler and easier to use. The only disadvantage we are aware of is that it's not clear that many/all of these new global options work with vo_opengl only. --vo=opengl-hq is also deprecated. There is extensive compatibility with the old behavior. One exception is that --vo-defaults will not apply to opengl-hq (though with opengl it still works). vo-cmdline is also dysfunctional and will be removed in a following commit. These changes also affect opengl-cb. The update mechanism is still rather inefficient: it requires syncing with the VO after each option change, rather than batching updates. There's also no granularity (video.c just updates "everything", and if auto-ICC profiles are enabled, vo_opengl.c will fetch them on each update). Most of the manpage changes were done by Niklas Haas <git@haasn.xyz>.
* command: deprecate "cache" property, replace with "cache-percent"wm42016-09-021-2/+4
| | | | | | The --cache option and cache property conflict, so one of them has to be renamed. The option is probably used frequently, so initiate deprecation/rename of the property.
* command: fix or document some property/option consistency issueswm42016-09-011-15/+12
| | | | | | | | | | | | | Make some existing properties behave more like options. This mostly means they don't deny access if the associated component is not active, but redirects to the option. One kind of fishy change is that we apply --brightness etc. only if they're not set to the default value. This won't necessarily work with --vo=xv, but affects only cases where 1. the Xv adapter has been changed to non-defaults, and 2. the user tries to reset them with mpv by passing e.g. --brightness=0. We don't care about Xv, and the noted use-case is dumb, so this change is acceptable.
* command: remove 2 deprecated propertieswm42016-09-011-50/+0
| | | | | They were delcared to be removed in mpv 0.20.0, and the next release will be 0.21.0.
* command: rename/deprecate some conflicting property nameswm42016-09-011-3/+7
| | | | | | These conflict with options of the same name, and prevent a "full" unification. Not addressed is the "cache" property, and possibly a few properties that behave differently from their equivalent options.
* command: add options to property listwm42016-09-011-36/+93
| | | | | | | | | | | Now options are accessible through the property list as well, which unifies them to a degree. Not all options support runtime changes (meaning affected components need to be restarted for the options to take effects). Remove from the manpage those properties which are cleanly mapped to options anyway. From the user-perspective they're just options available through the property interface.
* vo: change messy handling of fullscreen and other flagswm42016-08-301-10/+5
| | | | | | | | | | | | | | Before this commit, all VOs had to toggle the option flag themselves, now command.c does it. I can't really comprehend why it required every VO to do this manually. Maybe it was for rejecting the property/option change if the VO didn't support a specific capability. But then it could have checked the VOCTRL result. In any case, I don't care, and successfully changing the property without doing anything (With some VOs) is fine too. Many things work this way now, and it's simpler overall. This change will be useful for cleaning up VO option handling.
* options: make mp_vo_opts options an actual sub-option groupwm42016-08-301-8/+8
| | | | | | | | | | | Just a minor refactor along the planned option change. This commit will make it easier to update (i.e. copy) the VO options without copying _all_ options. For now, behavior should be equivalent, though. (The VO options were put into a separate struct quite early - when all global variables were removed from the source code. It wasn't clear whether the separate struct would have any actual purpose, but it seems it will now. Awesome, huh.)
* command: cosmetics: fix some minor whitespace mistakeswm42016-08-301-2/+2
|
* command: export profile list as a propertywm42016-08-281-0/+17
| | | | | | | Targeted at scripts, which can do whatever they want with it. This comes with the promise that they could get randomly broken any time. See #977.
* command: add property for current subtitle textwm42016-08-271-1/+21
| | | | Requested by someone. Reuses the code for terminal subtitle display.
* player: don't directly access demuxer->streamwm42016-08-261-4/+2
| | | | | | | | | | Cleaner and makes it easier to change the underlying stream. mp_property_stream_capture() still directly accesses it directly via demux_run_on_thread(). This is evil, but still somewhat sane and is not getting into the way here. Not sure if I got all field accesses.
* command: prevent O(n^2) behaviour for playlist propertyJames Ross-Gowan2016-08-201-3/+25
| | | | | | | | | When fetching the playlist property, playlist_entry_from_index would be called for each playlist entry, which traversed a linked list to get the entry corresponding to the specified index. This was very slow for large playlists. Since get_playlist_entry is called for each index in order, it can avoid a full traversal of the linked list by using the next pointer on the previously requested entry.
* player: make looping slightly more seamlesswm42016-08-181-37/+5
| | | | | | This affects A-B loops and --loop-file, and audio. Instead of dropping audio by resetting the AO, try to make it seamless by not sending data after the loop point, and after the seek send new data without a reset.
* player: allow passing flags to queue_seek()wm42016-08-151-12/+14
| | | | | | | | | | | | Change the last parameter from a bool to an int, which is supposed to take bit-flags. The at this point only flag is MPSEEK_FLAG_DELAY, which replaces the previous bool parameter. The old false parameter becomes 0, the old true parameter becomes MPSEEK_FLAG_DELAY. Since the old "immediate" parameter is now essentially inverted, two coalesced immediate and delayed seeks end up as delayed instead of immediate. This change doesn't matter, since there are no relative immediate seeks anyway.
* command: add replaygain information properties to track-listwm42016-08-131-0/+12
|
* command: add a property that returns filename without extensionwm42016-08-111-1/+13
| | | | Requested. Fixes #3404.
* audio: refactor mixer code and delete mixer.cwm42016-07-171-24/+11
| | | | | | | | | | | | | | | | | mixer.c didn't really deserve to be separate anymore, as half of its contents were unnecessary glue code after recent changes. It also created a weird split between audio.c and af.c due to the fact that mixer.c could insert audio filters. With the code being in audio.c directly, together with other code that unserts filters during runtime, it will be possible to cleanup this code a bit and make it work like the video filter code. As part of this change, make the balance code work like the volume code, and add an option to back the current balance value. Also, since the balance semantics are unexpected for most users (panning between the audio channels, instead of just changing the relative volume), and there are some other volumes, formally deprecate both the old property and the new option.
* Use - as command-name separator everywhereTimotej Lazar2016-07-141-5/+5
| | | | | | | Old-style commands using _ as separator (e.g. show_progress) were still used in some places, including documentation and configuration files. This commit updates all such instances to the new style (show-progress) so that commands are easier to find in the manual.
* command: add properties for HDR metadataNiklas Haas2016-07-131-0/+2
| | | | | | | | | Since it turns out that knowing what exactly a file was tagged with can be useful for debugging purposes, expose this as a property so I can check it more easily. This is mostly useful for sig-peak (since nom-peak is currently entirely calculated by us), but I added both for consistency.
* audio: show an osd bar when changing ao-volumeUros Vampl2016-07-101-1/+17
| | | | also, make the osd msg prettier
* audio: drop --softvol=no and --softvol=autowm42016-07-091-40/+68
| | | | | | | | | | | | | | Drop the code for switching the volume options and properties between af_volume and AO volume controls. interface-changes.rst mentions the changes in detail. Do this because this was exceedingly complex and had other problems as well. It was also very hard to test. It's just not worth the trouble. Some leftovers like AOCONTROL_HAS_PER_APP_VOLUME will be removed at a later point. Fixes #3322.
* command: don't delay progress updates to next video framewm42016-07-081-0/+1
|
* player: rewrite deinterlace filter auto-insertionwm42016-07-051-82/+0
| | | | | | | | | | | | | | Instead of using the "vf" command code (which changes filters at runtime on user input), use the general filter-insertion code. The latter was added later, and is more suitable for automatically inserted filters. The old code failed in particular when using watch-later saving, which stored the filter list in the resume config file. If a user changed the hardware decoding mode via command line, the stored filter chain was out of date and could cause failure due to not working with hardware or software decoding mode. Storing the deinterlace filter in the filter list was unavoidable, because it was part of the user state. (The new code only edits the actually instantiated filters.)
* mp_image: split colorimetry metadata into its own structNiklas Haas2016-07-031-4/+4
| | | | | | | | | | | | | | | | | | This has two reasons: 1. I tend to add new fields to this metadata, and every time I've done so I've consistently forgotten to update all of the dozens of places in which this colorimetry metadata might end up getting used. While most usages don't really care about most of the metadata, sometimes the intend was simply to “copy” the colorimetry metadata from one struct to another. With this being inside a substruct, those lines of code can now simply read a.color = b.color without having to care about added or removed fields. 2. It makes the type definitions nicer for upcoming refactors. In going through all of the usages, I also expanded a few where I felt that omitting the “young” fields was a bug.
* command: pack sub image data in overlay-add commandwm42016-07-011-33/+98
| | | | | | | | | | | | | | Working towards refcounted sub images, and also for removing bitmap packers from VOs. I'm not sure why we even have this overlay-add command. It was sort of "needed" before opengl-cb was introduced, and before Lua scripts could put ASS drawings on OSD without conflicting with the OSC. But now trying to use it doesn't make too much sense anymore. Still keep it because we're trying to be nice, but throw performance out of the window. Now image data is copied 2 more times before displaying it. This also makes using the command a bit simpler.
* command: improve playlist* properties change notificationswm42016-06-201-6/+9
| | | | | | | Until now, only the "playlist" property itself had proper change notification. Extend it to all other properties as well. Fixes #3267 (hopefully).
* player: do not update OSD all the time when pausedwm42016-06-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, OSD is updated every time the playloop is run. This has to be done, because the OSD may implicitly reference various properties, without knowing whether they really need to be updated or not. (There's a property update mechanism, but it's mostly unavailable, because OSD is special-cased and can not use the client API mechanism properly.) Normally, these updates are no problem, because the OSD is only actually printed when the OSD text actually changes. But commit d23ffd24 added a rate-limiting mechanism, which tries to limit OSD updates at most every 50ms (or the next video frame). Since it can't know in advance whether the OSD is going to change or not, this simply waked up the player every 50ms. Change this so that the player is updated only as part of general updates determined through mp_notify(). (This function also notifies the client API of changed properties.) The desired result is that the player will not wake up at all in normal idle mode, but still update properties that can change when paused, such as the cache. This is mostly a cosmetic change (in the sense of making runtime behavior just slightly better). It has the slightly more negative consequence that properties which update implicitly (such as "clock") will not update periodically anymore.
* vo_opengl: refactor performance data propertiesNiklas Haas2016-06-081-43/+34
| | | | | | | | | | | | | | | Instead of having 9 different properties, requiring 18 different VOCTRLs to read them all, they are now exposed as a single property. This is not only cleaner (since they're all together) but also allows querying all 9 of them with only a single VOCTRL (by using mp.get_property_native). (The extra factor of 2 was due to an extra query being needed to get the type, which is now also unnecessary) This makes it much easier to access performance metrics from within a lua script, and also makes it easier to just show a readable, formatted version via show-text.
* vo_opengl: expose performance timers as propertiesNiklas Haas2016-06-071-0/+43
| | | | | | | | | | | This is plumbed through a new VOCTRL, VOCTRL_PERFORMANCE_DATA, and exposed as properties render-time-last, render-time-avg etc. All of these numbers are in microseconds, which gives a good precision range when just outputting them via show-text. (Lua scripts can obviously still do their own formatting etc.) Signed-off-by: wm4 <wm4@nowhere>
* video: remove d3d11 video processor use from OpenGL interopwm42016-05-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have a video filter that uses the d3d11 video processor, so it makes no sense to have one in the VO interop code. The VO uses it for formats not directly supported by ANGLE (so the video data is converted to a RGB texture, which ANGLE can take in). Change this so that the video filter is automatically inserted if needed. Move the code that maps RGB surfaces to its own inteorp backend. Add a bunch of new image formats, which are used to enforce the new constraints, and to automatically insert the filter only when needed. The added vf mechanism to auto-insert the d3d11vpp filter is very dumb and primitive, and will work only for this specific purpose. The format negotiation mechanism in the filter chain is generally not very pretty, and mostly broken as well. (libavfilter has a different mechanism, and these mechanisms don't match well, so vf_lavfi uses some sort of hack. It only works because hwaccel and non-hwaccel formats are strictly separated.) The RGB interop is now only used with older ANGLE versions. The only reason I'm keeping it is because it's relatively isolated (uses only existing mechanisms and adds no new concepts), and because I want to be able to compare the behavior of the old code with the new one for testing. It will be removed eventually. If ANGLE has NV12 interop, P010 is now handled by converting to NV12 with the video processor, instead of converting it to RGB and using the old mechanism to import that as a texture.
* vf_d3d11vpp: add a D3D11 video processor filterwm42016-05-281-0/+3
| | | | | | | | | | | | | | | | | Main use: deinterlacing. I'm not sure how to select the deinterlacing mode at all. You can enumate the available video processors, but at least on Intel, all of them either signal support for all deinterlacers, or none (the latter is apparently used for IVTC). I haven't found anything that actually tells the processor _which_ algorithm to use. Another strange detail is how to select top/bottom fields and field dominance. At least I'm getting quite similar results to vavpp on Linux, so I'm content with it for now. Future plans include removing the D3D11 video processor use from the ANGLE interop code.
* command: add playlist-pos-1 propertywm42016-05-261-6/+20
| | | | | | | | | | This has often been requested for use on OSD. I don't really like having such "special" properties, but whatever. Hopefully this will be the only case. Untested because I'm too damn lazy. Fixes #2828.
* video: add --hwdec=auto-copy modewm42016-05-111-2/+0
| | | | | | | | This uses the normal autoprobing rules like "auto", but rejects anything that isn't flagged as copying data back to system memory. The chunk in command.c was dead code, so remove it instead of updating it.
* video: refactor how VO exports hwdec device handleswm42016-05-091-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The main change is with video/hwdec.h. mp_hwdec_info is made opaque (and renamed to mp_hwdec_devices). Its accessors are mainly thread-safe (or documented where not), which makes the whole thing saner and cleaner. In particular, thread-safety rules become less subtle and more obvious. The new internal API makes it easier to support multiple OpenGL interop backends. (Although this is not done yet, and it's not clear whether it ever will.) This also removes all the API-specific fields from mp_hwdec_ctx and replaces them with a "ctx" field. For d3d in particular, we drop the mp_d3d_ctx struct completely, and pass the interfaces directly. Remove the emulation checks from vaapi.c and vdpau.c; they are pointless, and the checks that matter are done on the VO layer. The d3d hardware decoders might slightly change behavior: dxva2-copy will not use the VO device anymore if the VO supports proper interop. This pretty much assumes that any in such cases the VO will not use any form of exclusive mode, which makes using the VO device in copy mode unnecessary. This is a big refactor. Some things may be untested and could be broken.
* win32: make taskbar progress indication optionalmaniak13492016-05-081-0/+19
| | | | | | | | | | | Add --taskbar-progress command line option and property which controls taskbar progress indication rendering in Windows 7+. This option is on by default and can be toggled during playback. This option does not affect the creation process of ITaskbarList3. When the option is turned off the progress bar is just hidden with TBPF_NOPROGRESS. Closes #2535
* command: use NBSP for spacing after current marker for OSD listswm42016-05-041-2/+2
| | | | |