summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* command: append entries to the end of the playlist with loadlist appendAlessandro Ghedini2014-07-261-1/+1
| | | | | | Currently entries are added after the current playlist element. This is kinda confusing, more so given that "loadfile append" appends at the end of the playlist.
* command: add append-play loadfile modewm42014-07-241-2/+2
| | | | | | | | "loadfile filename append-play" will now always append the file to the playlist, and if nothing is playing yet, start playback. I don't want to change the semantics of "append" mode, so a new mode is needed. Probably fixes issue #950.
* audio: drop buffered audio when switching tracks or filterswm42014-07-141-0/+1
| | | | | | | | No reason to wait until the audio has been played. This isn't a problem with gapless audio disabled, and since gapless is now default, this behavior might be perceived as regression. CC: @mpv-player/stable
* command: fix tv-channel propertywm42014-06-251-0/+3
| | | | | Now it's at least actually relayed to the TV code. I didn't/couldn't test whether it actually works, though.
* options: Expose --colormatrix-primaries to the userNiklas Haas2014-06-221-0/+29
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: redo the property typewm42014-06-131-506/+599
| | | | | | | | | | | | | | | | | | | | | | | Instead of absuing m_option to store the property list, introduce a separate type for properties. m_option is still used to handle data types. The property declaration itself now never contains the option type, and instead it's always queried with M_PROPERTY_GET_TYPE. (This was already done with some properties, now all properties use it.) This also fixes that the function signatures did not match the function type with which these functions were called. They were called as: int (*)(const m_option_t*, int, void*, void*) but the actual function signatures were: int (*)(m_option_t*, int, void*, MPContext *) Two arguments were mismatched. This adds one line per property implementation. With additional the reordering of the parameters, this makes most of the changes in this commit.
* Add more constwm42014-06-111-5/+5
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* command: redo ancient TV/DVB/PVR commandswm42014-06-111-153/+107
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* player: show "neutral" position markers for OSD barswm42014-06-081-2/+12
| | | | This commit implements them for volume and some video properties.
* command: format_bitrate: fix conversion to kbits and mbitsMarcoen Hirschberg2014-06-021-2/+2
| | | | | | | Bitrates are now expressed in bits/second. This commit fixes conversions which assumed it was still in bytes/second. Signed-off-by: wm4 <wm4@nowhere>
* command: improve video-bitrate propertyAndrey Morozov2014-06-011-1/+4
| | | | | | Signed-off-by: wm4 <wm4@nowhere> Includes some cosmetic changes over the original PR.
* client API: report success status when running commandswm42014-06-011-26/+42
| | | | | | Until now, an error was reported only if the command couldn't be parsed. Attempt to do more fine-grained reporting. This is not necessarily perfect, but it's an improvement.
* command: property notification when changing af/vfwm42014-06-011-0/+1
|
* command: add const to mp_notify_propertywm42014-06-011-1/+1
|
* audio: rename i_bps to 'bitrate' to avoid confusionMarcoen Hirschberg2014-05-281-4/+4
| | | | Since i_bps now contains bits/sec, rename it to reflect this change.
* audio: change values from bytes-per-second to bits-per-secondMarcoen Hirschberg2014-05-281-1/+1
| | | | | | | The i_bps members of the sh_audio and dev_video structs are mostly used for displaying the average audio and video bitrates. Keeping them in bits-per-second avoids truncating them to bytes-per-second and changing them back lateron.
* command: add write_watch_later_config commandMartin2014-05-261-0/+5
| | | | | | Closes #808. Signed-off-by: wm4 <wm4@nowhere>
* stream: don't use end_poswm42014-05-241-7/+4
| | | | | | | | | | | | | | | | | | | Stop using it in most places, and prefer STREAM_CTRL_GET_SIZE. The advantage is that always the correct size will be used. There can be no doubt anymore whether the end_pos value is outdated (as it happens often with files that are being downloaded). Some streams still use end_pos. They don't change size, and it's easier to emulate STREAM_CTRL_GET_SIZE using end_pos, instead of adding a STREAM_CTRL_GET_SIZE implementation to these streams. Make sure int64_t is always used for STREAM_CTRL_GET_SIZE (it was uint64_t before). Remove the seek flags mess, and replace them with a seekable flag. Every stream must set it consistently now, and an assertion in stream.c checks this. Don't distinguish between streams that can only be forward or backwards seeked, since we have no such stream types.
* stream: kill start_pos, remove --sb optionwm42014-05-241-13/+1
| | | | | | | | | | | | | | | | | | | | stream.start_pos was needed for optical media only, and (apparently) not for very good reasons. Just get rid of it. For stream_dvd, we don't need to do anything. Byte seeking was already removed from it earlier. For stream_cdda and stream_vcd, emulate the start_pos by offsetting the stream pos as seen by the rest of mpv. The bits in discnav.c and loadfile.c were for dealing with the code seeking back to the start in demux.c. Handle this differently by assuming the demuxer is always initialized with the stream at start position, and instead seek back if initializing the demuxer fails. Remove the --sb option, which worked by modifying stream.start_pos. If someone really wants this option, it could be added back by creating a "slice" stream (actually ffmpeg already has such a thing).
* player: give quit_watch_later an exit code argument like quitwm42014-05-221-6/+3
| | | | | | | | The quit command has an optional argument that is used as exit code. Extend that to the quit_watch_later command. Actually, unify the implementations of the two commands. Requested in #798.
* options: unify code for setting string and "raw" optionswm42014-05-181-6/+5
| | | | | | | | | The code paths for setting options by string and by direct "raw" value were too different, which resulted in some weird code. Make the code paths closer to each other. Also, use this to remove the weirdness in the mpv_set_option() implementation.
* command: add a disc-menu-active propertywm42014-05-181-0/+11
| | | | Returns whether a DVD/BD menu is active. As requested by #788.
* player: reorganize how lua scripts are loadedwm42014-05-131-1/+0
| | | | | | Make loading of scripts independent of Lua. Move some of the loading code from lua.c to scripting.c, and make it easier to add new scripting backends.
* input: remove pausing command prefixeswm42014-05-111-9/+0
| | | | | | These are now equivalent to combining commands with the "cycle pause" or "set pause" commands, and thus are not needed anymore. They were also obscure and undocumented.
* command: add property that estimates current video FPSwm42014-05-081-0/+27
| | | | | | | | | | | | | | | | | | This is done after filters, so things like framerate-doubling deinterlacing is accounted for. Unfortunately, framedropping can cause inaccuracies (especially after precise seeks), and we can't really know when that happens. Even though we know that the decoder might drop a frame if we request it to do so, we don't know when the dropped frame will start or stop affecting the video filter chain. Video filters can have frames buffered, and we can't tell at which point the dropped frame would have been output. It's not even possible to mark a discontinuity after seek, because again we don't know if the filter chain still has the discontinuity within its buffers. So we have to live with the fact that the output of this property can be completely broken after seek, unless --no-hr-seek-framedrop is used.
* command: rename stream-length to file-size, format file sizeAndrey Morozov2014-05-061-13/+44
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: remove ifdefs for deint filterswm42014-05-061-4/+0
| | | | Doesn't have much of a purpose.
* common: change mp_snprintf_append semanticswm42014-05-051-2/+2
| | | | | | | | Make it more suitable for chaining. This means a function formatting a value to a string using a static buffer can work exactly like mp_snprintf_append itself. Also rename it to mp_snprintf_cat, because that's shorter.
* options: rename video-related options/propertiesMartin Herkt2014-05-041-1/+1
| | | | | | | | | | | Renamed options: --aspect → --video-aspect --fstype → --x11-fstype --native-fs → --fs-missioncontrol --name → --x11-name Renamed properties: aspect → video-aspect
* options: rename audio-related options/propertiesMartin Herkt2014-05-041-2/+2
| | | | | | | | | | | | | Renamed options: --audiofile → --audio-file --audiofile-cache → --audio-file-cache --channels → --audio-channels --format → --audio-format --srate → --audio-samplerate Renamed properties: samplerate → audio-samplerate channels → audio-channels
* video: handle colorspace and aspect overrides separatelywm42014-05-021-3/+3
| | | | | Now the video filter code handles these explicitly, which should increase robustness (or at least find bugs earlier).
* command, vo_vdpau: respect vdpau deint sub-optionwm42014-05-021-2/+15
| | | | | This is a horrible hack to keep compatibility with the vo_vdpau deint sub-option.
* command: redo deinterlace filter probingwm42014-05-021-18/+27
| | | | | | | Give up on the deint_filters[] array, and probe using explicit code instead. Add additional checks to test the pixel format to avoid annoying warnings when a hardware deinterlacer is inserted when the current video chain is obviously incompatible.
* command: make enabling deinterlacing with vdpau workwm42014-05-021-0/+3
| | | | | | This restores the capability of enabling deinterlacing with the 'cycle deinterlace' command with vo_vdpau, and also makes it work with vo_opengl.
* vf-metadata: fix handling of NULL metadataKevin Mitchell2014-04-291-11/+16
| | | | | | lavfi would segfault due to a NULL dereference if it was asked for its metadata and none had been allocated (oops). This happens for libav which has no concept of filter metadata.
* client API: add chapter change eventwm42014-04-271-0/+1
| | | | Also works for mpv_observe_property() on the "chapter" property.
* video: add a "hwdec" property to enable or disable hw decoding at runtimewm42014-04-231-0/+33
|
* command: export rotation parameterwm42014-04-221-0/+1
| | | | For completeness.
* player: add a --loop-file optionwm42014-04-171-0/+1
| | | | Unlike --loop, loops a file instead of the playlist.
* client API: remove mpv_event_pause_reasonwm42014-04-141-5/+5
| | | | | | | | | And slightly adjust the semantics of MPV_EVENT_PAUSE/MPV_EVENT_UNPAUSE. The real pause state can now be queried with the "core-idle" property, the user pause state with the "pause" property, whether the player is paused due to cache with "paused-for-cache", and the keep open event can be guessed with the "eof-reached" property.
* command: add property to indicate when pausing due to --keep-openwm42014-04-141-2/+11
| | | | | | | This property is set to "yes" if playback was paused due to --keep-open. The change notification might not always be perfect; maybe that should be improved.
* command: add a property to indicate core pause statewm42014-04-141-2/+11
| | | | | | | | | Currently this is (probably) equivalent to "paused-for-cache", but the latter is a bit special, while this new property is a bit more general. One case where they might actually be different is dvdnav menus, but I haven't checked. Also add property change notifications for these two properties.
* command: vf-metadata: minor fixup of return statusKevin Mitchell2014-04-141-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: add vf-metadata propertyKevin Mitchell2014-04-131-1/+37
| | | | | | | This is a read-only property that uses VFCTRL_GET_METADATA to retrieve mp_tags metadata from a filter specified by label Signed-off-by: wm4 <wm4@nowhere>
* player: remove ASX, SMIL and NSC playlist parserswm42014-04-131-1/+0
| | | | | | | | | | | | | | | | | | | These playlist parsers are all what's left from the old mplayer playlist parsing code. All of it is old code that does little error checking; the type of C string parsing code that gives you nightmare. Some playlist parsers have been rewritten and are located in demux_playlist.c. The removed formats were not reimplemented. ASX and SMIL use XML, and since we don't want to depend on a full blown XML parser, this is not so easy. Possibly these formats could be supported by writing a very primitive XML-like lexer, which would lead to success with most real world files, but I haven't attempted that. As for NSC, I couldn't find any URL that worked with MPlayer, and in general this formats seems to be more than dead. Move playlist_parse_file() to playlist.c. It's pretty small now, and basically just opens a stream and a demuxer. No use keeping playlist_parser.c just for this.
* command: add paused-for-cache, total-avsync-change, drop-frame-count propertiesDavid Weber2014-04-131-0/+33
| | | | | | | | | This is needed if you want to reimplement the status line in lua I could only test drop-frame-count because I didn't find an easy way to trigger paused-for-cache and total-avsync-change Signed-off-by: wm4 <wm4@nowhere>
* cache: allow resizing at runtimewm42014-04-091-0/+29
| | | | | | | | | | | The only tricky part is keeping the cache contents, which is made simple by allocating the new cache while still keeping the old cache around, and then copying the old data. To explain the "Don't use this when playing DVD or Bluray." comment: the cache also associates timestamps to blocks of bytes, but throws away the timestamps on seek. Thus you will experience strange behavior after resizing the cache until the old cached region is exhausted.
* command: property set commands should send property change notificationswm42014-04-081-1/+21
| | | | | | | | | Some of these property implementations already send notifications on their own, but most don't. This takes care of them. Of course this still doesn't handle all propertry changes - this is impossible without special-casing each property that can change on its own.
* client API: add a way to notify clients of property changeswm42014-04-061-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | This turned out ridiculously complex. I think it will have to be simplified some day. Main reason for the complexity are: - filtering properties by forcing clients to observe individual properties explicitly (to avoid spamming clients with changes they don't want) - optional retrieval of property value with the notification (the basic idea was that this is more user friendly) - allowing to the client to specify a format in which the value should be retrieved (because if a property changes its type, the client API couldn't convert it properly, and compatibility would break) I don't know yet which of these are important, and everything could change. In particular, the interface and semantics should be adjusted to reduce the implementation complexity. While I consider the API complete, there could (and probably will) be bugs left. Also while the implementation is complete, it's inefficient. The complexity of the property matching is O(a*b*c) with a clients, b observed properties, and c properties changing at once. I threw away an earlier implementation using bitmasks, because it was too unwieldy.
* command: change what the metadata property returnswm42014-03-301-8/+20
| | | | | | | Change the type of the property from a string list (alternating key/value entries) to a map. Using the client API, this will return MPV_FORMAT_NODE_MAP, while Lua mp.get_property_native returns a dictionary-like table.
* command: minor simplificationwm42014-03-301-6/+3
|
* command: add helper function to split property pathswm42014-03-301-5/+8
| | | | | | We've just checked whether a sub-path started with "name/", but that changes behavior whether the property name has a trailing '/' or not. Using a helper function to split of path components avoids this problem.
* Merge remote-tracking branch 'mpv/pr/676'wm42014-03-301-1/+1
|\
| * player: rename dvdnav to discnavxylosper2014-03-301-1/+1
| | | | | | | | | | Now, navigation works both of DVD and non-BD-J Blu-ray. Therefore, rename all 'dvdnav' strings which are not DVD specific to 'discnav'
* | video/out: remove legacy colorspace stuffwm42014-03-291-9/+9
|/ | | | | | | | | Reduce most dependencies on struct mp_csp_details, which was a bad first attempt at dealing with colorspace stuff. Instead, consistently use mp_image_params. Code which retrieves colorspace matrices from csputils.c still uses this type, though.
* player: fix unchecked access for chapter metadatawm42014-03-261-3/+1
| | | | | | | | | | It's possible that MPContext has a chapter list, but the demuxer doesn't. In this case, accesing the chapter-metadata property would lead to invalid accesses. (This fixes the out of bound access, but in theory, the returned data can still be incorrect, since MPContext chapters don't need to map directly to demuxer chapters.)
* player: let chapter_start_time() return MP_NOPTS_VALUE for unknown timeswm42014-03-251-1/+1
|
* command: make 'disc-title' property writablexylosper2014-03-181-2/+8
| | | | | | | | This commit makes 'disc-title' property writable using STREAM_CTRL_SET_CURRENT_TITLE. This commit also contains implementation of STREAM_CTRL_SET_CURRENT_TITLE for stream_bluray. Currently, 'disc-title' is writable only for stream_dvdnav and stream_bluray and stream_dvd is not supported.
* command, lua: change script_message semanticswm42014-03-171-1/+9
| | | | | | | | Change script_message to broadcast the message to all clients. Add a new script_message_to command, which does what the old script_message command did. This is intended as simplification, although it might lead to chaos too.
* command: rename dvd- properties to disc-wm42014-03-151-7/+7
| | | | Since these are not DVD-only, but can also be used with BDs.
* command: prefix DVD title properties with "dvd-"wm42014-03-151-8/+8
| | | | | | | | | | They're strictly DVD-only, so it's better to mark them as such. This also documentes the "title" (now renamed to "dvd-title") property. This also avoids collision with the --title option. (Technically, there was no problem. But it might be confusing for users, since we have a policy of naming properties and o