summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* command: fix property notification for cache-buffering-statewm42016-03-021-1/+1
|
* command: add encoder-list propertywm42016-03-011-1/+14
| | | | | Also change decoder-list (for the sake of sharing the underlying code for both properties).
* command: export canonical ffmpeg version identifierwm42016-02-291-0/+11
| | | | Was printed only with "mpv -h" or so.
* command: export list of all decoderswm42016-02-291-0/+32
| | | | | | | Was only available via --vd=help and --ad=help (i.e. not at all via client API). Not bothering with separating audio and video codecs, since this list isn't all that useful anyway in general. If someone complains, a type field could be added.
* command: export more information under track-listwm42016-02-291-3/+21
| | | | | | | | | | | | | Export a number of container fields, which may or may not be useful in some scenarios. They are explicitly marked as originating from the demuxer, in order to make it explicit that they might be unreliable. I'd actually like to remove all other cases where container information is exported, but those numerous cases are going to be somewhat hard to deprecate. Also, not directly related, export the description of the currently active decoder. (This has been requested before.)
* player: remove unused MPContext.stream fieldwm42016-02-231-1/+1
| | | | | | | It was just dead code. Also fixes the stream-open-filename property, which is supposed to be read-only if a file was already opened.
* player: remove old timeline/ordered chapters supportwm42016-02-151-18/+18
|
* player: force refresh seek when changing audio filterswm42016-02-091-3/+0
| | | | | | | | | | | | | Unfortunately I see no better solution. The refresh seek is skipped if the amount of buffered audio is not overly huge. Unfortunately softvol af_volume insertion still can cause this issue, because it's outside of the normal dynamic filter chain changing code. Move the video refresh call to reinit_video_filters() to make it more uniform along with the audio code.
* input: ignore --input-cursor for events injected by input commandswm42016-02-041-6/+6
| | | | | | Apparently useful for window embedding. Fixes #2750.
* sub: implement "sub-seek 0"wm42016-02-041-1/+1
| | | | | | | For bitmap subs, implement it properly. For libass, you need newest git master. Fixes #2791.
* command: fix track cycling logicwm42016-02-031-9/+4
| | | | | | Also remove the unused function argument. Fixes #2784.
* command: show original aspect in video-aspect property toowm42016-02-021-16/+19
| | | | | Basically, just make it append " (original)" if the original aspect ratio is selected.
* player: refactor: reduce some dependencies on current_trackwm42016-02-011-7/+3
| | | | Don't mind me.
* vd_lavc: allow switching between hw/sw decoding any timewm42016-01-291-2/+1
| | | | | | | We just need to provide an entrypoint for it, and move the main init code to a separate function. This gets rid of the messy video chain full reinit in command.c, which completely destroyed and recreated the video state for the purpose of mid-stream hw/sw switching.
* command: always allow setting volume/mute propertieswm42016-01-261-5/+17
| | | | | | | | | | | | | | | | | | | | | | | This seems generally easier when using libmpv (and was already requested and implemented before: see commit 327a779a; it was reverted some time later). With the weird internal logic we have to deal with, in particular the --softvol=no case (using system volume), and using the audio API's mixer (--softvol=auto on some systems), we still can't avoid all glitches and corner cases that complicate this issue so much. The API user is either recommended to use --softvol=yes or auto, or to watch the new mixer-active property, and assume the volume/mute properties have significant values if the mixer is active. Remaining glitches: - changing the volume/mute properties has no effect if no internal mixer is used (--softvol=no) and the mixer is not active; the actual mixer controls do not change, only the property values - --volume/--mute do not have an effect on the volume/mute properties before mixer initialization (the options strictly are only applied during mixer init) - volume-max is 100 while the mixer is not active
* command: add af-command commandwm42016-01-221-0/+6
| | | | Similar to vf-command. Requested. Untested.
* command: add vf-command commandwm42016-01-221-0/+6
|
* player: refactor: eliminate MPContext.d_audiowm42016-01-221-5/+7
|
* audio: refactor: work towards unentangling audio decoding and filteringwm42016-01-221-4/+4
| | | | | | | | | Similar to the video path. dec_audio.c now handles decoding only. It also looks very similar to dec_video.c, and actually contains some of the rewritten code from it. (A further goal might be unifying the decoders, I guess.) High potential for regressions.
* command: fix NULL pointer deref in "video-codec" propertywm42016-01-181-1/+1
| | | | Fixes #2729.
* player: refactor: eliminate MPContext.d_videowm42016-01-171-43/+43
| | | | | | | | | | | | | | Eventually we want the VO be driven by a A->V filter, so a decoder doesn't even have to exist. Some features definitely require a decoder though (like reporting the decoder in use, hardware decoding, etc.), so for each thing which accessed d_video, it has to be redecided if and how it can access decoder state. At least the "framedrop" property slightly changes semantics: you can now always set this property, even if no video is active. Some untested changes in this commit, but our bio-based distributed test suite has to take care of this.
* player: refactor: eliminate MPContext.d_subwm42016-01-171-1/+2
| | | | The same is going to happen to d_video and d_audio later.
* command: modify OSD message when forcing original video aspect ratiowm42016-01-161-0/+7
| | | | | | | Not bothering with anything advanced, so we just show "(original)" if the video-aspect property/option is reset. Fixes #2722.
* video: refactor: disentangle decoding/filtering some morewm42016-01-161-1/+1
| | | | | | | | | | | This moves some code related to decoding from video.c to dec_video.c, and also removes some accesses to dec_video.c from the filtering code. dec_video.ch is starting to make sense, and simply returns video frames from a demuxer stream. The API exposed is also somewhat intended to be easily changeable to move decoding to a separate thread, if we ever want this (due to libavcodec already being threaded, I don't see much of a reason, but it might still be helpful).
* osd: make osd-width/height properties watchablewm42016-01-151-1/+1
|
* video: fix interactively changing aspect ratiowm42016-01-141-1/+1
| | | | | | | | | The aspect ratio calculations are cached (mainly so that aspect ratio related messages are not logged on every frame). The cache is not clared anymore when video filters are reconfigured, but changing the video-aspect-ratio property relied on it. Make it explicit. Fixes #2714.
* player: prefer "service_name" as media title.Oliver Freyermuth2016-01-141-0/+3
| | | | | If it is defined, which it rarely is (e.g. mpegts streams) this is the preferred title information.
* player: implement SWITCH for dvb-channel-name property, add binding.Oliver Freyermuth2016-01-141-0/+8
| | | | | | | | The binding is similar to the tv-binding, just with capital letters. Switching the dvb-channel-name property compared to dvb-channel means the channel-name is shown on-screen when switching instead of "dvb-channel (error)" otherwise, and switching anyways happens without changing the card.
* player: remove unused last_dvb_step member.Oliver Freyermuth2016-01-141-2/+0
| | | | | | Channel switching is treated inside the global DVB state by now. Anyways the last switching direction is not really useful and of no interest inside the player.
* player, stream_dvb: implement dvb-channel-name property.Oliver Freyermuth2016-01-141-0/+22
| | | | | | | | | On read, it returns the name of the current DVB program, on write, it triggers a channel-switch to the program if it is found in the channel list of the currently active card. Compared to the dvb-channel property which already exists and is a pair of integers (card + channel number) this has the limitation of not switching the card, but is probably of much more common use.
* video: decouple filtering/decoding slightly morewm42016-01-141-25/+24
| | | | | | | | | | | | | | | | | | | Lots of noise to remove the vfilter/vo fields from dec_video. From now on, video filtering and output will still be done together, summarized under struct vo_chain. There is the question where exactly the vf_chain should go in such a decoupled architecture. The end goal is being able to place a "complex" filter between video decoders and output (which will culminate in natural integration of A->V filters for natural integration of libavfilter audio visualizations). The vf_chain is still useful for "final" processing, such as format conversions and deinterlacing. Also, there's only 1 VO and 1 --vf option. So having 1 vf_chain for a VO seems ideal, since otherwise there would be no natural way to handle all these existing options and mechanisms. There is still some work required to truly decouple decoding.
* video: refactor: handle video format fixups closer to decoderwm42016-01-141-3/+3
| | | | | | | | | | Instead of handling this on filter chain reinit, do it directly after the decoder. This makes the code less entangled. In particular, this gets rid of the really weird "override params" concept in the video filter code. The last_format/fixed_formats have some redundance with decoder_output, but unfortunately the latter has a slightly different use.
* demux: merge sh_video/sh_audio/sh_subwm42016-01-121-12/+11
| | | | | | | | | | This is mainly a refactor. I'm hoping it will make some things easier in the future due to cleanly separating codec metadata and stream metadata. Also, declare that the "codec" field can not be NULL anymore. demux.c will set it to "" if it's NULL when added. This gets rid of a corner case everything had to handle, but which rarely happened.
* mpv_talloc.h: rename from talloc.hDmitrij D. Czarkoff2016-01-111-1/+1
| | | | This change helps avoiding conflict with talloc.h from libtalloc.
* command: replace ROUND() with lrint()wm42015-12-261-5/+4
| | | | | lrint() pretty much does what ROUND() is supposed to do, but it's more precise.
* command: change heuristic for files with 1 chapterwm42015-12-251-2/+3
| | | | | | | | | For files with only 1 chapter, the "cycle" command was ignored. Reenable it, but don't let it terminate playback of the file. For the full story, see #2550. Fixes #2550.
* command: fix eof-reached property change notification in corner caseswm42015-12-241-2/+2
| | | | | | | | | See #2609: "When eof is reached it would be shown on the OSD and in the console. Next try seeking to the middle. Seeking to the middle of the file will only result in the OSD message being updated. Lua seems to fail to observe the change in the property until the video is unpaused."
* input: add key name to script-binding command responsewm42015-12-231-2/+2
| | | | | | | | | | | | | | | | The "script-binding" command is used by the Lua scripting wrapper to register key bindings on the fly. It's also the only way to get fine- grained information about key events (such as separate key up/down events). This information is sent via a "key-binding" message when the state of a key changes. Extend it to send name of the mapped key itself. Previously, it was assumed that the user just uses an unique identifier for the binding's name, so it wasn't needed. With this change, a user can map exactly the same command to multiple keys, which is useful especially with the next commit. Part of #2612.
* vf_yadif: change defaultswm42015-12-211-1/+1
| | | | | | | | | | | | | | | | This is for the sake of command.c and the "deinterlace" option/property. Instead of forcing certain "better" defaults when inserting yadif, change the actual "yadif" defaults. I pondered not changing vf_yadif, and instead adding a trivial "yadif- auto" wrapper filter, which would merely have different defaults. But thinking about it, it doesn't make any sense for "deinterlace" to have different defaults from vf_yadif, with vf_yadif having the "worse" defaults. If someone wants the old behavior, the old behavior can be forced in a backward and forward compatible way by setting the suboptions. Fixes #2539 (kind of).
* video: switch from using display aspect to sample aspectwm42015-12-191-10/+12
| | | | | | | | | | | | | | | | MPlayer traditionally always used the display aspect ratio, e.g. 16:9, while FFmpeg uses the sample (aka pixel) aspect ratio. Both have a bunch of advantages and disadvantages. Actually, it seems using sample aspect ratio is generally nicer. The main reason for the change is making mpv closer to how FFmpeg works in order to make life easier. It's also nice that everything uses integer fractions instead of floats now (except --video-aspect option/property). Note that there is at least 1 user-visible change: vf_dsize now does not set the display size, only the display aspect ratio. This is because the image_params d_w/d_h fields did not just set the display aspect, but also the size (except in encoding mode).
* command, vo: add estimated-display-fps propertywm42015-11-251-1/+30
| | | | | | | | | | This is simply the average refresh rate. Including "bad" samples is actually an advantage, because the property exists only for informational purposes, and will reflect problems such as the driver skipping a vsync. Also export the standard deviation of the vsync frame duration (normalized to the range 0-1) as vsync-jitter property.
* command: export some per-video-frame informationwm42015-11-221-0/+25
| | | | Utterly useless, but requested. Fixes #2444.
* player: remove OSD subtitle render pathwm42015-11-171-4/+3
| | | | | | | | | | | | | | | | | | | This was used with --no-sub-ass (aka --no-ass). This option (which is not yet removed) strips all styling from the subtitles, and renders them as plaintext only. For some reason, it originally seemed convenient to reuse all the OSD text rendering code (osd_libass.c). While this was indeed simple, it had a bad influence on the rest of the code. For example, it had to decide whether to go through the OSD code path, or the proper subtitle renderer in sd_ass.c. Kill the OSD subtitle renderer. Reimplement --no-sub-ass and also "secondary" subtitles in sd_ass.c. fill_plaintext() contains some rather minor code duplication with osd_libass.c for setting up a dummy ASS_Event and escaping the stripped text. Since sd_ass.c already has to handle "normal" text subtitles, and has code for stripping ASS tags, this remains all relatively simple. Remove all the unnecessary crap from the rest of the code.
* player: use demuxer ts offset to simplify timeline ts handlingwm42015-11-161-1/+1
| | | | | | | | | Use the demux_set_ts_offset() added in the previous commit to base each timeline segment to use timestamps according to its relative position within the overall timeline. As a consequence we don't need to care about these timestamps anymore, and everything becomes simpler. (Another minor but delicious nugget of sanity.)
* player: handle rebasing start time differentlywm42015-11-161-7/+3
| | | | | | | | | | | | | | | | Most of this is explained in the DOCS additions. This gives us slightly more sanity, because there is less interaction between the various parts. The goal is getting rid of the video_offset entirely. The simplification extends to the user API. In particular, we don't need to fix missing parts in the API, such as the lack for a seek command that seeks relatively to the start time. All these things are now transparent. (If someone really wants to know the real timestamps/start time, new properties would have to be added.)
* command: add vsync-ratio propertywm42015-11-131-2/+25
| | | | | | | | This is very "illustrative", unlike the video-speed-correction property, and thus useful. It can also be used to observe scheduling errors, which are not detected by the core. (These happen due to rounding errors; possibly not evne our fault, but coming from files with rounded timestamps and so on.)
* player: refactor display-sync frame duration calculationswm42015-11-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Get rid of get_past_frame_durations(), which was a bit too messy. Add a past_frames array, which contains the same information in a more reasonable way. This also means that we can get the exact current and past frame durations without going through awful stuff. (The main problem is that vo_pts_history contains future frames as well, which is needed for frame backstepping etc., but gets in the way here.) Also disable the automatic disabling of display-sync if the frame duration changes, and extend the frame durations allowed for display sync. To allow arbitrarily high durations, vo.c needs to be changed to pause and potentially redraw OSD while showing a single frame, so they're still limited. In an attempt to deal with VFR, calculate the overall speed using the average FPS. The frame scheduling itself does not use the average FPS, but the duration of the current frame. This does not work too well, but provides a good base for further improvements. Where this commit actually helps a lot is dealing with rounded timestamps, e.g. if the container framerate is wrong or unknown, or if the muxer wrote incorrectly rounded timestamps. While the rounding errors apparently can't be get rid of completely in the general case, this is still much better than e.g. disabling display-sync completely just because some frame durations go out of bounds.
* command: rename vo-missed-frame-count propertywm42015-11-131-5/+5
| | | | | | | | | "Missed" implies the frame was dropped, but what really happens is that the following frame will be shown later than intended (due to the current frame skipping a vsync). (As of this commit, this property is still inactive and always returns 0. See git blame for details.)
* command: make display-fps property writablewm42015-11-091-7/+9
| | | | | | | Has the same function as setting the option. This commit changes the property in a bunch of other ways. For example if the VO is not created, it will return the option value.
* command: add mistimed-frame-count propertywm42015-10-301-3/+12
| | | | | Does what the manpage says. This is a replacement incrementing the dropped frame counter (see previous commit).
* command: make bitrate properties work correctly for external trackswm42015-10-231-2/+7
|
* command: do not return 0 for bitrates if unknownwm42015-10-231-0/+2
| | | | | | | | This makes the bitrate properties unavailable, instead of returning 0 when: 1. No track is selected, or 2. Not enough packets have been read to have a bitrate estimate yet
* command: make time properties unavailable if timestamp is unknownwm42015-10-161-0/+6
| | | | | | Let's hope this doesn't confuse client API users too much. It's still the best solution to get rid of corner cases where it actually return the wrong timestamp on start, and then suddenly jump.
* player: fix inverted conditionwm42015-10-131-1/+1
| | | | | | | Simple oversight which made it not work at all. How did this ever work, and if it was never tested, then why did it work when fixing this oversight?
* player: make stop command actually stopwm42015-10-061-1/+1
| | | | | | | | | | | | | The stop command didn't always stop. In this case, opening a HLS URL and then sending "stop" during loading would actually make it fallback to parsing it as a playlist, and then continued to play the playlist items. (This corner case makes several unfortunate factors come together to produce this really odd behavior.) Another issue is that the "stop" was not always explicitly set. This could be a problem when sending several commands at once. Only the "quit" command should have priority over the "stop" command, so this is still checked.
* video: remove user-controllable PTS sorting (--pts-association-mode)wm42015-10-061-2/+0
| | | | | | | | | Useless. Sometimes it might be useful to make some extremely broken files work, but on the other hand --no-correct-pts is sufficient for these cases. While we still need some of the code for AVI, the "auto" mode in particular inflated the size of the code.
* video: replace vf_format outputlevels option with global optionwm42015-09-291-5/+5
| | | | | | | | | | | The vf_format suboption is replaced with --video-output-levels (a global option and property). In particular, the parameter is removed from mp_image_params. The mechanism is moved to the "video equalizer", which also handles common video output customization like brightness and contrast controls. The new code is slightly cleaner, and the top-level option is slightly more user-friendly than as vf_format sub-option.
* af_lavfi: implement af-metadata propertywm42015-09-111-10/+21
| | | | | | | Works like vf-metadata. Unfortunately requires some code duplication (even though it's not much). Fixes #2311.