summaryrefslogtreecommitdiffstats
path: root/player/command.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | | | | | Opening the stream and opening the demuxer are both done asynchronously, meaning the player reacts to client API requests. They also can potentially take a while. Thus it's better to process outstanding property changes, so that change events are sent for properties that were changed during opening.
* command: improve observability of some audio propertieswm42015-02-011-1/+2
| | | | | | | | | In particular, this would fix the sending the initial change event. It was easily missed because MPV_EVENT_FILE_LOADED usually triggered it, but the actual property could change only later, because audio initialization really is kind of asynchronous to it. This probably fixes #1544.
* command: change sub-visibility OSD messagewm42015-01-291-1/+2
| | | | | | | | | | | | | Now it shows one of: - "Subtitles hidden" (sub-visibility=no) - "Subtitles visible" (sub-visibility=yes, sub!=no) - "Subtitles visible (but no subtitles selected)" (otherwise) It should be a bit more self-explanatory than before. On the other hand, I have no clue about UI issues. This also gets close to what's reasonably possible with the OSD expansion string syntax, which is why it looks so awful.
* player: remove redundant variablewm42015-01-291-2/+2
| | | | | | mpctx->audio_delay always has the same value as opts->audio_delay. (This was not the case a long time ago, when the audio-delay property didn't actually write to opts->audio_delay. I think.)
* command: export more details about file seekabilitywm42015-01-261-0/+10
| | | | | | | | | | If a file is unseekable (consider e.g. a http server without resume functionality), but the stream cache is active, the player will enable seeking anyway. Until know, client API user couldn't know that this happens, and it has implications on how well seeking will work. So add a property which exports whether this situation applies. Fixes #1522.
* input, player: new command for mouse eventxylosper2015-01-231-0/+19
| | | | | | | New command `mouse <x> <y> [<button> [single|double]]` is introduced. This will update mouse position with given coordinate (`<x>`, `<y>`), and additionally, send single-click or double-click event if `<button>` is given.
* command: export file format as propertywm42015-01-231-0/+12
| | | | | | | | | | | | Repurpose demuxer->filetype for this. It used to be used to print a human readable format description; change it to a symbolic format name and export it as property. Unfortunately, libavformat has its own weird conventions, which are reflected through the new property, e.g. the .mp4 case mentioned in the manpage. Fixes #1504.
* player: some fixes for property notificationxylosper2015-01-231-3/+3
| | | | | | | | | | `core-idle` depends on seeking state `mpctx->restart_complete`, so make `core-idle` notified whenever `seeking` is notified, too. `paused-for-cache` can be changed on MPV_EVENT_CACHE_UPDATE obviously. Finally, `MPV_EVENT_PLAYBACK_RESTART` should be notified after `mpctx->restart_complete` changed.
* x11: add --on-all-workspaces option and propertywm42015-01-161-0/+9
| | | | Fixes #1469.
* command: unify handling of fullscreen and other VO flagswm42015-01-161-21/+12
| | | | | | | | The "ontop" and "border" properties already used a common mp_property_vo_flag() function, and the corresponding VOCTRLs used the same conventions. "fullscreen" is pretty similar, but was handled slightly similar. Change how VOCTRL_FULLSCREEN behaves, and use the same helper function for "fullscreen" as the other flags.
* command: fix property naming conventionwm42015-01-101-2/+2
| | | | Use "-" instead of "_" as separator.
* command: change properties added in previous commitwm42015-01-101-10/+7
| | | | | | | | | | | | | Make their meaning more exact, and don't pretend that there's a reasonable definition for "bits-per-pixel". Also make unset fields unavailable. average_depth still might be inconsistent: for example, 10 bit 4:2:0 is identified as 24 bits, but RGB 4:4:4 as 12 bits. So YUV formats seemingly drop the per-component padding, while RGB formats do not. Internally it's consistent though: 10 bit YUV components are read as 16 bit, and the padding must be 0 (it's basically like an odd fixed- point representation, rather than a bitfield).
* command.c: new subproperties for video-params: bpp and depthxylosper2015-01-101-0/+12
| | | | | | | | bpp(bits-per-pixel) and depth(bit-depth for color component) can be calculated from pixelformat technically but it requires massive informations to be implemented in client side. These subproperties are provided for convenience.
* command: ignore chapter cycling if there's only 1 chapterwm42015-01-051-2/+5
| | | | | | If there's only 1 chapter, the seeking by chapter (using the chapter property) will either jump to the chapter point, or quit playback. This is as designed, but seems like a useless and annoying behavior.
* x11: make display-names property observablewm42015-01-031-1/+1
| | | | Reuse MP_EVENT_WIN_STATE for this.
* command: make the "run" command work on Windows toowm42015-01-011-22/+35
| | | | | | | | | Do so by using mp_subprocess(). Although this uses completely different code on Unix too, you shouldn't notice a difference. A less ncie thing is that this reserves an entire thread while the command is running (which wastes some memory for stack, at least). But this is probably still the simplest way, and the fork() trick is apparently not implementable with posix_subprocess().
* command: make empty vf-metadata not an errorwm42014-12-301-11/+6
| | | | | | | | If a filter exists, but has no metadata, just return success. This allows the user to distinguish between no metadata available, and filter not inserted. See #1408.
* command: add filtered-metadata propertywm42014-12-291-1/+12
| | | | | Goes in hand with the previous commit; the main purpose is to easily show on OSD what is shown on terminal.
* player: make --shuffle/--merge-files affect runtime loaded playlistswm42014-12-291-5/+5
| | | | | | | Until now, these options took effect only at program start. This could be confusing when e.g. doing "mpv list.m3u --shuffle". Make them always take effect when a playlist is loaded either via a playlist file, or with the "loadlist" command.
* command: stip path from playlist OSD displaywm42014-12-271-2/+8
| | | | | | But only if it's not e.g. a http URL. Fixes #1388.
* player: cosmetics: rename a functionwm42014-12-271-1/+1
| | | | | Something which has this many important sideffects shouldn't start have a "get" prefix.
* command: overlay_add: more flexible treatment of offset parameterwm42014-12-261-8/+12
| | | | | | | | | | | | | | Essentially, don't make it the mmap() argument, and just add it to the memory address. This hides tricky things like alignment reequirements from the user. Strictly speaking, this is not entirely backwards compatible: this adds the regression that you can't access past 2 or 4 GB of a file on 32 bit systems anymore. But I doubt anyone cared about this. In theory, we could be clever, and just align the offset manually and pass that to mmap(). This would also be transparent to the user, but minimally more effort, so this is left as exercise to the reader.
* win32: add mmap() emulationwm42014-12-261-9/+0
| | | | | | | | Makes all of overlay_add work on windows/mingw. Since we now don't explicitly check for mmap() anymore (it's always present), this also requires us to make af_export.c compile, but I haven't tested it.
* player: don't show "0%" percentage in infinite streamswm42014-12-201-2/+6
|
* command: extend revert_seek commandwm42014-12-171-2/+10
| | | | | "revert_seek mark" basically forces the seekback point. It's basically a one-way bookmark.
* command: format ${avsync} like on terminal status linewm42014-12-161-0/+4
| | | | | | Padding with spaces is very useless for OSD (because most fonts are variable width), but it's good when using it on the terminal, e.g. for reproducing the default terminal status line.
* command, dvd: add property which returns list of DVD titleswm42014-12-131-0/+33
| | | | | | | | | This was requested. It seems libdvdread can't get the duration for titlesets other than the currently opened title. The data structures contain dangling pointers for these, and MPlayer works this around by opening every title separately for the purpose of dumping the title list.
* command: add properties for current bitratewm42014-12-121-0/+23
| | | | Fixes #1192.
* command: fix crash with some forms of script_bindingwm42014-12-101-1/+1
| | | | "script_binding name ..." just crashed it. Oops.
* player: update chapter marks when switching fileswm42014-12-101-0/+4
| | | | | This wasn't done, so the chapter marks of the previous file were visible. It's harmless, but looks unpolished, so fix it.
* command: add "idle" propertywm42014-12-101-2/+16
| | | | Yes, it's redundant with events.
* player: change interaction between revert_seek and ab-loopswm42014-12-091-0/+1
| | | | | | The result isn't quite what I imagined, because the A-point is never marked as a seek point (so you can't jump between A and B), but it's still slightly better than before.
* player: make chapter seek to end jump to last frame with --keep-openwm42014-12-081-1/+5
| | | | | | | | There were complaints that a chapter seek past the last chapter was quitting the player. Change the behavior to what is expected: the last frame. If no chapters are available, this still does nothing.
* command: avoid returning invalid FPS valueswm42014-11-291-3/+5
| | | | It's possible that fps is sometimes 0 in case it's unset.
* command: sub_add with "auto" should not always select a subtitle trackwm42014-11-271-1/+3
| | | | | | | | | | | Running "sub_add file.srt auto" during hook execution automatically selected the first added track. This happened because all tracks added with sub_add are marked as "external", and external subtitles are always selected by default. Fix this by negating the "external" flag when autoselecting subtitles during loading. The no_default flag exists for this purpose; it was probably added for libquvi originally, where we had the same issue.
*