summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* command: add keypress, keydown, and keyup commands.torque2015-06-111-0/+30
| | | | | These commands are used to simulate keypresses using the key names from input.conf.
* command: fix audio-out-detected-device propertywm42015-06-091-2/+3
| | | | | | | Used a wrong condition, and I suppose it could crash in some situations. Change it to lazily initialize the hotplug stuff, like the audio-device-list property does.
* command: remove unnecessary event IDswm42015-06-091-2/+0
| | | | | These were actually not needed for correct function, since individual property change notifications via mp_notify_property() are used.
* command: make property event mask matching more restrictivewm42015-06-091-1/+2
| | | | | | This was matching e.g. both "foo/bar" and "foobar" against "foo", when only the former should match. This could cause more property notifications than necessary.
* player: print track list when switching trackswm42015-06-031-0/+4
|
* player: print a message along with track listwm42015-06-031-4/+4
| | | | Slightly less strange.
* player: don't print stream list when adding external tracks during loadwm42015-06-031-5/+7
| | | | | | | | | There's a short time during loading where external commands can add external streams even before the main file is loaded (like during ytdl hook execution). The track list is printed every time an external track is added via commands. This was quite awkward when ytdl was adding multiple streams, so don't print it in this stage. They are printed anyway at the end of the loading process.
* command: remove deprecated get_property commandwm42015-05-271-34/+0
| | | | | | This command has been deprecated in the 0.8.x and 0.9.x releases - get rid of it. Its only point ever was MPlayer compatibility, which broke years ago anyway.
* command: better choice when to allow playback-related commandswm42015-05-261-16/+16
| | | | | | | | For certain reasons, we allow adding external tracks even before the main file is loaded. This somewhat breaks in old assumption, which uses mpctx->num_sources to determine whether a command can be applied in the current state. Use the newer playback_initialized instead, which is a much better choice for this purpose.
* command: fix track property when no file is loadedwm42015-05-261-2/+8
| | | | | | | | | | | The previous commit removed this. Although mp_switch_track() can now be called in all situations, we still don't want it to be called here. Setting a track property while no file is loaded would simply deselect the track instead of setting the underlying option to the requested value. Likewise, if the "cycle" command (M_PROPERTY_SWITCH) is used, don't just deselect the track.
* player: fix crashes when adding external tracks before loading main filewm42015-05-261-20/+13
| | | | | | | | | | | | | | | | Adding an external audio track before loading the main file didn't work right. For one, mp_switch_track() assumes it is called after the main file is loaded. (The difference is that decoders are only initialized once the main file is loaded, and we avoid doing this before that for whatever reason.) To avoid further messiness, just allow mp_switch_track() to be called at any time. Also make it do what mp_mark_user_track_selection() did, since the latter requires current_track to be set. (One could probably simply allow current_track to be set at this point, but it'd interfere with default track selection anyway and thus would be pointless.) Fixes #1984.
* command: change the hwdec propertieswm42015-05-251-30/+43
| | | | | | Another very minor step towards property/option unification. Not bothering with interface compatibility here.
* video: do not use MP_NOPTS_VALUE for A/V differencewm42015-05-241-2/+0
| | | | | | There's no need for this, it just creates more corner cases. Also always reset it on seeks etc..
* player: add function to compute past frame durationswm42015-05-241-17/+6
| | | | | And use it for the estimated-vf-fps property (it should be doing the same as before).
* command: add protocol-list propertywm42015-05-231-0/+16
| | | | Fixes #1972.
* command: allow changing track properties while no file is loadedwm42015-05-221-16/+20
| | | | | | | | | | Now it simply changes the options, i.e. what will be requested, instead of returning M_PROPERTY_UNAVAILABLE. This is another minor step towards unifying options and properties. Still a bit weird: it will always return "no" if no file is loaded, and disregards the option value.
* player: use an array for stream ID options and suchwm42015-05-221-4/+2
| | | | This makes the code slightly more generic.
* command: deprecate audio-sampleratewm42015-05-221-43/+2
| | | | | | | Also replace their implementation with the recently introduced properties. One significant difference is that audio-channels using OSD formatting does not print the channel layout. The user can just use the replacement property instead.
* command: add audio-params and audio-out-params propertieswm42015-05-221-1/+40
|
* command: rename audio-format propertywm42015-05-221-4/+6
| | | | Clashes with the option.
* command: deprecate the "length" propertywm42015-05-221-4/+4
| | | | It collides with the --length option.
* command: add a new property deprecation mechanismwm42015-05-221-0/+29
| | | | Looks like this will be needed a lot...
* audio: change range of volume option/propertywm42015-05-221-2/+2
| | | | | | | | | Now --volume takes an absolute volume, meaning it doesn't depend on --softvol-max. 0 is still silence, and 100 now always means unchanged volume. The OSD and the "volume" property are changed accordingly. Also raise the minimum value of --softvol-max. A value below 100 makes no sense and breaks the OSD.
* command: explicitly show mouse cursor when unfullscreeningwm42015-05-211-2/+6
|
* command: refactor if/else statements to switchRobin2015-05-201-11/+19
| | | | | | The code checking for the type of seeking contained some if else statements. To improve readability, I decided to refactor those statements to a switch statement.
* command: change OSD symbol for absolute perc. seekrrooij2015-05-191-2/+4
| | | | | | | | | | The OSD symbol for seeking to an absolute percentage was always OSD_FFW, even when it should be OSD_REW. It uses the correct OSD symbols now, by checking the current position ratio. Note: The symbol is still incorrectly given when the absolute percentage is very close to the current position ratio. Fortunately, that's a rare use case.
* command: use consistent comment stylerrooij2015-05-191-1/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* input: add relative percentage seekrrooij2015-05-191-0/+5
| | | | | | | | | | | Only absolute percentage seeking was permitted first. It is now also possible to seek by relative percentage. MPSEEK_FACTOR is used as seek_type. Fixes #1950. Signed-off-by: wm4 <wm4@nowhere>
* command: add playlist_shuffle commandwm42015-05-171-0/+5
| | | | Fixes #965.
* command: let sub_reload remove the old track firstwm42015-04-281-8/+10
| | | | | | In the most simple case, this prevents the track ID from changing. One disadvantage is that if the file fails loading, the track is gone for good and would have to be re-added explicitly by the user.
* player: log track list when adding or removing external fileswm42015-04-281-0/+5
| | | | | | | | | Should help with debugging, and might be slightly more userfriendly. Note that this is called manually in multiple entry-points, instead of the functions doing the actual work (like mp_remove_track()). This is done so that exiting the player or calling the sub_reload command won't print redundant in-between states.
* command: demuxer-cache-time propertyxylosper2015-04-211-1/+21
| | | | | | | | Approximate time of video buffered in the demuxer, in seconds. Same as `demuxer-cache-duration` but returns the last timestamp of bufferred data in demuxer. Signed-off-by: wm4 <wm4@nowhere>
* client API: add a screenshot_raw commandwm42015-04-201-0/+39
| | | | | | | | | Requested. The wild code for setting up the mpv_node probably deserves to be cleaned up later. Fixes #1800.
* client API: add glue for making full use of mpv_command_node()wm42015-04-201-2/+2
| | | | | Until now, the return value was always MPV_FORMAT_NONE. Now a command can actually set it. This will be used in one of the following commits.
* player: change video-bitrate and audio-bitrate propertieswm42015-04-201-47/+28
| | | | | | | | | | | | | | Remove the old implementation for these properties. It was never very good, often returned very innaccurate values or just 0, and was static even if the source was variable bitrate. Replace it with the implementation of "packet-video-bitrate". Mark the "packet-..." properties as deprecated. (The effective difference is different formatting, and returning the raw value in bits instead of kilobits.) Also extend the documentation a little. It appears at least some decoders (sipr?) need the AVCodecContext.bit_rate field set, so this one is still passed through.
* command: disc-mouse-on-button propertyxylosper2015-04-211-0/+9
| | | | | This property indicates whether mouse cursor is located on button or not for disc naviation.
* subprocess: move implementation for deatched subprocesseswm42015-04-151-34/+1
|
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: new subproperty for video-params: gammaNiklas Haas2015-04-041-0/+5
|
* command: remove unused functionwm42015-04-011-14/+0
|
* video: move colorspace overrides to vf_format, simplifywm42015-03-311-120/+21
| | | | | | | | | | | | | | | | | | | Remove the colorspace-related top-level options, add them to vf_format. They are rather obscure and not needed often, so it's better to get them out of the way. In particular, this gets rid of the semi-complicated logic in command.c (most of which was needed for OSD display and the direct feedback from the VO). It removes the duplicated color-related name mappings. This removes the ability to write the colormatrix and related properties. Since filters can be changed at runtime, there's no loss of functionality, except that you can't cycle automatically through the color constants anymore (but who needs to do this). This also changes the type of the mp_csp_names and related variables, so they can directly be used with OPT_CHOICE. This probably ended up a bit awkward, for the sake of not adding a new option type which would have used the previous format.
* command: add property returning current working directorywm42015-03-241-0/+20
| | | | Requested; fixes #1717.
* command: use mp_set_playlist_entrySai Ke WANG2015-03-221-3/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* osd: simplify an aspect of change detection handlingwm42015-03-181-1/+1
| | | | | | | | | | | | | | | | | | There was a somewhat obscure optimization in the OSD and subtitle rendering path: if only the position of the sub-images changed, and not the actual image data, uploading of the image data could be skipped. In theory, this could speed up things like scrolling subtitles. But it turns out that even in the rare cases subtitles have such scrolls or axis-aligned movement, modern libass rarely signals this kind of change. Possibly this is because of sub-pixel handling and such, which break this. As such, it's a worthless optimization and just introduces additional complexity and subtle bugs (especially in cases libass does the opposite: incorrectly signaling a position change only, which happened before). Remove this optimization, and rename bitmap_pos_id to change_id.
* command: don't drop audio buffers when switching filterswm42015-03-161-1/+0
| | | | | | | This partially reverts commit ae7228c6. I guess the old behavior was slightly more popular. Fixes #1693 (probably).
* command: make "media-title" observablewm42015-03-151-1/+1
| | | | If metadata changes, its value could change.
* command: fix display-fps property (again)wm42015-03-131-3/+3
| | | | | | | This caused complaints because the fps was basically rounded on microsecond boundaries in the vsync interval (it seemed convenient to store only the vsync interval). So store the fps as float too, and let the "display-fps" property return it directly.
* command: display-fps is the display FPS as assumed by the VOwm42015-03-121-4/+4
| | | | | | | | | Requested change in behavior. Note that we set the assumed "infinite" display_fps to 1e6, which conveniently lets vo_get_vsync_interval() return a dummy value of 1, which can be easily checked against, and still avoids doing math with float INFs.
* command: allow changing some VO options even if VO wasn't created yetwm42015-03-111-4/+4
| | | | | | | | | | | | Instead of refusing to set properties like "fullscreen" if no VO was created, always allow it. So if no VO is created, setting the property merely changes the options (and will be applied once the VO is created). This is consistent with similar behavior changes to some other properties. Improves the behavior reported in #1676. Also, we shouldn't check the config_ok variable - the VO should do this.
* command: add display-fps propertywm42015-03-101-1/+17
| | | | Requested. Untested; leaving that to the users.
* player: use symbolic constant for seek precisionwm42015-03-041-14/+16
| | | | Meh.
* input: use flag option type for some input commandswm42015-03-041-4/+11
| | | | | | | | | | This gets rid of the need for a second (or more) parameters; instead it can be all in one parameter. The (now) redundant parameter is still parsed for compatibility, though. The way the flags make each other conflict is a bit tricky: they have overlapping bits, and the option parser disallows setting already set bits.
* client API: make some more properties observablewm42015-02-271-1/+2
| | | | A/V sync things.
* command: add rescan_external_fileswm42015-02-161-0/+18
| | | | | | | | | Requested. Hopefully will be useful for things that download and add external subtitles on demand. Or something. Closes #1586.
* command: nicer OSD message when setting audio-devicewm42015-02-161-0/+14
| | | | Requested.
* sub: mess with styling defaults, change --ass-use-margins behaviorwm42015-02-161-1/+2
| | | | | | | | | | | | | | | | | | | Now --ass-use-margins doesn't apply to normal subtitles anymore. This is probably the inverse from the mpv behavior users expected so far, and thus a breaking change, so rename the option, that the user at least has a chance to lookup the option and decide whether the new behavior is wanted or not. The basic idea here is: - plain text subtitles should have a certain useful defalt behavior, like actually using margins - ASS subtitles should never be broken by default - ASS subtitles should look and behave like plaintext subtitles if the --ass-style-override=force option is used This also subtly changes --sub-scale-with-window and adds the --ass- scale-with-window option. Since this one isn't so important, don't bother with compatibility.
* player: fix audio-device-list updateswm42015-02-141-0/+5
| | | | | | | The way the AO wakes up the playloop has nothing to do with events; instead we must query the events on the AO once the playloop was woken up. Querying the events in every playloop iteration is thus the correct way to do this.
* ao_coreaudio: add support for hotplug notificationsStefano Pigozzi2015-02-141-4/+9
| | | | | | | | | | This commit adds notifications for hot plugging of devices. It also extends the old behaviour of the `audio-out-detected-device` property which is now backed by the hotplugging code. This allows clients to be notified when the actual audio output device changes. Maybe hotplugging should be supported for ao_coreaudio_exclusive too, but it's device selection code is a bit fragile.
* command: mark get_property as deprecatedwm42015-02-131-0/+4
| | | | | Using it just makes no sense. But we're really being nice about this and don't remove it immediately.
* audio: add device change notification for hotpluggingwm42015-02-121-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not very important for the command line player; but GUI applications will want to know about this. This only adds the internal API; support for specific audio outputs comes later. This reuses the ao struct as context for the hotplug event listener, similar to how the "old" device listing API did. This is probably a bit unclean and confusing. One argument got reusing it is that otherwise rewriting parts of ao_pulse would be required (because the PulseAudio API requires so damn much boilerplate). Another is that --ao-defaults is applied to the hotplug dummy ao struct, which automatically applies such defaults even to the hotplug context. Notification works through the property observation mechanism in the client API. The notification chain is a bit complicated: the AO notifies the player, which in turn notifies the clients, which in turn will actually retrieve the device list. (It still has the advantage that it's slightly cleaner, since the AO stuff doesn't need to know about client API issues.) The weird handling of atomic flags in ao.c is because we still don't require real atomics from the compiler. Otherwise we'd just use atomic bitwise operations.
* command: new commands audio_add/audio_remove/audio_reloadxylosper2015-02-031-23/+30
| | | | | | | | These commands are counterparts of sub_add/sub_remove/sub_reload which work for external audio file. Signed-off-by: wm4 <wm4@nowhere> (minor simplification)
* command: add property returning detected audio deviceStefano Pigozzi2015-02-031-1/+11
| | | | | This can be useful to adjust some other audio related properties at runtime depending on the audio device being used.
* command: add property returning detected hwdec APIwm42015-02-021-1/+32
| | | | | | | | | This is somewhat imperfect, because detection of hw decoding APIs is mostly done on demand, and often avoided if not necessary. (For example, we know very well that there are no hw decoders for certain codecs.) This also requires every hwdec backend to identify itself (see hwdec.h changes).
* command: add properties returning the current VO and AO driverwm42015-02-021-2/+18
| | | | This wasn't possible before.
* command: add dummy get implementation for tv-channel propertywm42015-02-021-0/+2
| | | | | A small cosmetic change with the effect that pressing 'k' shows "unavailable" instead of "error" (even if no TV code is active).
* command: send additional property change events in-between loadingwm42015-02-011-0/+1
| | | | | | |