summaryrefslogtreecommitdiffstats
path: root/core
Commit message (Collapse)AuthorAgeFilesLines
* Remove old demuxerswm42013-07-072-8/+6
| | | | | | | | | | Delete demux_avi, demux_asf, demux_mpg, demux_ts. libavformat does better than them (except in rare corner cases), and the demuxers have a bad influence on the rest of the code. Often they don't output proper packets, and require additional audio and video parsing. Most work only in --no-correct-pts mode. Remove them to facilitate further cleanups.
* Remove internal network supportwm42013-07-073-15/+33
| | | | | | | | | | | This commit removes the "old" networking code in favor of libavformat's code. The code was still used for mp_http, udp, ftp, cddb. http has been mapped to libavformat's http support since approximately 6 months ago. udp and ftp have support in ffmpeg (though ftp was added only last month). cddb support is removed with this commit - it's probably not important and rarely used if at all, so we don't care about it.
* core: make network options available even if old net code is disabledwm42013-07-072-2/+18
| | | | Preparation for removing the old network code.
* playlist: don't add entries in reversewm42013-07-051-0/+1
| | | | | | | | The entries were always added after the insertion point - but that means the entries are appended in reverse order. So update the insertion point on each entry. Regression introduced by commit 5f664d7.
* core: remove mp_fifo leftoverswm42013-07-041-40/+0
|
* cocoa: remove usage of mp_fifoStefano Pigozzi2013-07-031-1/+0
| | | | | | Update Cocoa parts to remove usage of the mp_fifo internal API to send events to the core and use the input context directly. This is to follow commits the work in commits 70a8079c and d603e73c.
* core: cleanup more mp_fifo leftoverswm42013-07-023-3/+0
| | | | Now only the OSX and Wayland parts are using this.
* core: remove mp_fifo indirectionwm42013-07-029-106/+73
| | | | | | | | | | For some reason mp_fifo specifically handled double clicks, and other than that was a pointless wrapper around input.c functionality. Move the double click handling into input.c, and get rid of mp_fifo. Add some compatibility wrappers, because so much VO code uses these functions. Where struct mp_fifo is still used it's just a casted struct input_ctx.
* command: add some playlist manipulation commandswm42013-07-025-0/+44
| | | | playlist_remove and playlist_move.
* core: update metadata during playback, allow streams to export metadatawm42013-07-022-0/+6
| | | | | | | STREAM_CTRL_GET_METADATA will be used to poll for streamcast metadata. Also add DEMUXER_CTRL_UPDATE_INFO, which could in theory be used by demux_lavf.c. (Unfortunately, libavformat is too crappy to read metadata mid-stream for mp3 or ogg, so we don't implement it.)
* input: require VOs to send key up events, redo input key lookupwm42013-07-024-76/+80
| | | | | | | | | | | | | | Making key up events implicit was sort-of a nice idea, but it's too tricky and unreliable and makes the key lookup code (interpret_keys()) hard to reason about. See e.g. previous commit for subtle bugs and issues this caused. Make key-up events explicit instead. Add key up events to all VOs. Any time MP_KEY_STATE_DOWN is used, the matching key up event must use MP_KEY_STATE_UP. Rewrite the key lookup code. It should be simpler and more robust now. (Even though the LOC increases, because the new code is less "compact".)
* input: fix behavior if there are actually key up eventswm42013-07-021-1/+2
| | | | | | | | | Wayland is the only backend that actually sends per-key key up events (the X11 one just sends MP_INPUT_RELEASE_ALL for simplicity). Handling was broken with Wayland, and each key event was interpreted twice, once on key down and once on key up. This commit should fix it.
* input: don't ignore press-only mouse button eventswm42013-06-301-1/+2
| | | | | | | | Before this commit, only mouse events with both down and up events were processed. This caused a regression with ignoring mouse wheel events in cocoa, because these don't distinguish between up and down. Regression caused by 5b38a52.
* dec_sub: introduce sub_control(), use it for sub_stepwm42013-06-291-8/+7
| | | | | | | This means the direct libass usage can be removed from command.c, and no weird hacks for retrieving the ASS_Track are needed. Also fix a bug when using this feature with ordered chapters.
* command: redraw subs if sub-delay is changedwm42013-06-291-1/+1
| | | | | Though in practice this probably happened anyway, because OSD was redrawn.
* sub: update subtitle time offset even if pausedwm42013-06-291-5/+5
| | | | | | This was changed as part of commit b44202b as an intended simplification, but it's actually nicer to have the subtitles update immediately even if paused.
* input: store number of binds, instead of using 0-terminationwm42013-06-291-60/+54
|
* input: store number of keys, instead of using 0-terminationwm42013-06-291-21/+24
|
* input: don't keep separate sections for builtin key bindingswm42013-06-291-62/+76
| | | | | | | | | | Instead mark individual key bindings as builtin. Not sure whether this is conceptually simpler or more complicated. For one, it requires the annoying remove_binds() function to wipe existing bindings instead of just killing the section, on the other hand it gets rid of almost all special handling of builtin vs. normal sections.
* mplayer: don't hide mouse cursor if mouse is inside mouse areawm42013-06-292-1/+5
|
* input: trigger mouse_leave key bindings if mouse leaves mouse areawm42013-06-293-12/+52
| | | | | | Also, implement mouse leave events for X11. But evne on other platforms, these events will be generated if mouse crosses a section's mouse area boundaries within the mpv window.
* command: add commands to enable/disable input sectionswm42013-06-293-0/+19
| | | | | For now, it's mostly for testing. It also might allow to create key binding state machines, but this sounds questionable.
* input: handle mouse movement differentlywm42013-06-296-145/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, mouse movement events emitted a special command ("set_mouse_pos"), which was specially handled in command.c. This was once special-cased to the dvdnav and menu code, and did nothing after libmenu and dvdnav were removed. Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"), which then can be bound to an arbitrary command. The mouse position is now managed in input.c. A command which actually needs the mouse position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos() to query it. The former returns raw window-space coordinates, while the latter returns coordinates transformed to OSD- space. (Both are the same for most VOs, except vo_xv and vo_x11, which can't render OSD in window-space. These require extra code for mapping mouse position.) As of this commit, there is still nothing that uses mouse movement, so MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the mouse (much like MOUSE_BTN0). Extend the concept of input sections. Allow multiple sections to be active at once, and organize them as stack. Bindings from the top of the stack are preferred to lower ones. Each section has a mouse input section associated, inside which mouse events are associated with the bindings. If the mouse pointer is outside of a section's mouse area, mouse events will be dispatched to an input section lower on the stack of active sections. This is intended for scripting, which is to be added later. Two scripts could occupy different areas of the screen without conflicting with each other. (If it turns out that this mechanism is useless, we'll just remove it again.)
* command: make raw percent-pos property return fractionswm42013-06-291-3/+6
| | | | | | | | | percent-pos was an integer (0-100). Sometimes higher precision is wanted, but the property is this way because fractional parts would look silly with normal OSD usage. As a compromise, make percent-pos double (i.e. includes fractional parts), but print it as integer. So ${percent-pos} is like an integer, but not ${=percent-pos}.
* command: add properties for playlist positionwm42013-06-295-9/+102
| | | | | playlist-pos can set/get the current playlist index. playlist-count returns the number of entries in the playlist.
* core: add libquvi 0.9 supportwm42013-06-285-9/+286
| | | | | | | | | | | | | This adds support for libquvi 0.9.x, and these features: - start time (part of youtube URL) - youtube subtitles - alternative source switching ('l' and 'L' keys) - youtube playlists Note that libquvi 0.9 is still in development. Although this seems to be API stable now, it looks like there will be a 1.0 release, which is supposed to be the next stable release and the actual successor of libquvi 0.4.x.
* core: rename mplayer.h and quvi.cwm42013-06-284-10/+6
| | | | | | mplayer.h used to be used for much more stuff, but all what is left are quvi related definitions. Rename quvi.c as well to make its purpose clearer.
* options: rename --mkv-subtitle-preroll, --dtshdwm42013-06-281-2/+6
| | | | We still keep the old names as alias for short-time compatibility.
* options: rename --rawvideo to --demuxer-rawvideo, same with --rawaudiowm42013-06-281-3/+2
|
* options: rename -lavdopts to -vd-lavc, -lavfdopts to -demuxer-lavfwm42013-06-281-3/+4
| | | | | Also change manpage so that top-level options are documented instead of suboptions. Suboptions still work, but might go away eventually.
* options: remove -lavdopts debug suboptionwm42013-06-281-1/+0
| | | | This can be set as avopt instead.
* Merge branch 'sub_mess2'wm42013-06-259-92/+325
|\ | | | | | | ...the return.
| * options: add -sub-speed optionwm42013-06-252-0/+3
| | | | | | | | | | | | | | | | Should we actually get into trouble for unproper handling of frame-based subtitle formats, this might be the simplest way to work this around. Also is a bit more intuitive than -subfps, which might use an unknown, misdetected, or non-sense video FPS. Still pretty silly, though.
| * sub: libguess support for -subcpwm42013-06-251-1/+27
| | | | | | | | Actually this is rather disappointing.
| * sub: add subtitle charset conversionwm42013-06-252-0/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was once part of subreader.c, then traveled to libass, and now made its way back to the fork of the fork of the original code, MPlayer. It works pretty much the same as subreader.c, except that we have to concatenate some packets to do auto-detection. This is rather annoying, but for all we know the actual source file could be a binary format. Unlike subreader.c, the iconv context is reopened on each packet. This is simpler, and with respect to multibyte encodings, more robust. Reopening is probably not a very fast, but I suspect subtitle charset conversion is not an operation that happens often or has to be fast. Also, this auto-detection is disabled for microdvd - this is the only format we know that has binary data in its packets, but is actually decoded to text. FFmpeg doesn't really allow us to solve this properly, because a) the input packets can be binary, and b) the output will be checked whether it's UTF-8, and if it's not, the output is thrown away and an error message is printed. We could just recode the decoded subtitles before sd_ass if it weren't for that.
| * sub: add demux_libass wrapper, drop old hackswm42013-06-255-78/+15
| | | | | | | | | | | | | | | | | | | | | | | | demux_libass.c allows us to make subtitle format detection part of the normal file loading process. libass has no probe function, but trying to load the start of a file (the first 4 KB) is good enough. Hope that libass can even handle random binary input gracefully without printing stupid log messages, and that the libass parser doesn't accept too many non-ASS files as input. This doesn't handle the -subcp option correctly yet. This will be fixed later.
| * core: don't set correct-pts mode randomlywm42013-06-251-0/+8
| | | | | | | | | | | | The default correct-pts mode depended on which demuxer was opened last. Often this is the subtitle demuxer. The correct-pts mode should be decided on the demuxer for video instead.
| * subreader: turn into actual demuxerwm42013-06-252-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subreader.c (before this commit renamed to demux_subreader.c) was special cased to the -sub option. The plan is using the normal demuxer codepath for all subtitle formats (so we can prefer libavformat demuxers for most formats). There are some subtle changes. The probe size is restricted to 32 KB (instead of unlimitted + giving up after 100 lines of input). For formats like MicroDVD, the video FPS isn't used anymore, because it's not available on the subtitle demuxer level. Instead, hardcode it to 23.976 FPS (libavformat seems to do the same). The user can probably still use -sub-fps to fix the timing. Checking the file extension for ".utf"/".utf8"/".utf-8" is simply removed (seems worthless, was in the way, and I've never seen this anywhere).
| * Move/rename subreader.cwm42013-06-251-1/+1
| |
| * sub: do some timing postprocessing on preloaded subswm42013-06-231-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the -subfps option (which unfortunately is still useful), and fixes minor annoying timing errors (which unfortunately still happen). Note that none of these affect ASS or image subtitles. ASS is specially handled: libass loads subtitles as ASS_Track. There are no actual packets passed around, and sd_ass just uses the ASS_Track. Disable the --sub-no-text-pp option. It's misleading now and always was completely useless.
| * sub: preload external text subtitleswm42013-06-231-0/+10
| | | | | | | | | | | | | | | | If a subtitle is external, read it completely and add all subtitle events in advance when the subtitle track is selected. This is done for text subtitles only. (Note that subreader.c and subtitles loaded with libass are different and don't have anything to do with this commit.)
| * sub: remove redundant conditionwm42013-06-231-2/+2
| |
| * stream: remove padding parameter from stream_read_complete()wm42013-06-232-2/+2
| | | | | | | | | | | | | | | | Seems like a completely unnecessary complication. Instead, always add a 1 byte padding (could be extended if a caller needs it), and clear it. Also add some documentation. There was some, but it was outdated and incomplete.
* | av_log: change how ffmpeg log messages are formattedwm42013-06-221-4/+8
| | | | | | | | | | | | | | | | | | | | Don't print the ffmpeg context pointer as %p. This is usually useless and confusing. Prefix all messages with "ffmpeg" to make clear that ffmpeg is printing these messages, and not us. If libavcodec is from Libav, use "libav" as prefix instead. (In theory, FFmpeg/Libav libraries could be mixed, but I don't think that is actually possible in practice.)
* | encoding: use --start for ratios, etc.Rudolf Polzer2013-06-202-7/+24
| | | | | | | | | | Note: this currently only works for formats without pts resets. Other formats will ignore this code.
* | command line: allow --o= to disable encoding (i.e. empty string file name)Rudolf Polzer2013-06-201-3/+3
| |
* | encode_lavc: simplify encoding status output; remove percentageRudolf Polzer2013-06-204-19/+18
|/
* Merge branch 'cache_new'wm42013-06-163-24/+22
|\
| * cache: use threads instead of fork()wm42013-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically rewrite all the code supporting the cache (i.e. anything other than the ringbuffer logic). The underlying design is untouched. Note that the old cache2.c (on which this code is based) already had a threading implementation. This was mostly unused on Linux, and had some problems, such as using shared volatile variables for communication and uninterruptible timeouts, instead of using locks for synchronization. This commit does use proper locking, while still retaining the way the old cache worked. It's basically a big refactor. Simplify the code too. Since we don't need to copy stream ctrl args anymore (we're always guaranteed a shared address space now), lots of annoying code just goes away. Likewise, we don't need to care about sector sizes. The cache uses the high-level stream API to read from other streams, and sector sizes are handled transparently.
| * cache: make the stream cache a proper stream that wraps other streamswm42013-06-162-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, the cache was franken-hacked on top of the stream API. You had to use special functions (like cache_stream_fill_buffer() instead of stream_fill_buffer()), which would access the stream in a cached manner. The whole idea about the previous design was that the cache runs in a thread or in a forked process, while the cache awa functions made sure the stream instance looked consistent to the user. If you used the normal functions instead of the special ones while the cache was running, you were out of luck. Make it a bit more reasonable by turning the cache into a stream on its own. This makes it behave exactly like a normal stream. The stream callbacks call into the original (uncached) stream to do work. No special cache functions or redirections are needed. The only different thing about cache streams is that they are created by special functions, instead of being part of the auto_open_streams[] array. To make things simpler, remove the threading implementation, which was messed into the code. The threading code could perhaps be kept, but I don't really want to have to worry about this special case. A proper threaded implementation will be added later. Remove the cache enabling code from stream_radio.c. Since enabling the cache involves replacing the old stream with a new one, the code as-is can't be kept. It would be easily possible to enable the cache by requesting a cache size (which is also much simpler). But nobody uses stream_radio.c and I can't even test this thing, and the cache is probably not really important for it either.
| * core: use STREAM_CTRL instead of accessing stream_dvd internalswm42013-06-091-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | Some code in mplayer.c did stuff like accessing (dvd_priv_t *)st->priv. Do this indirectly by introducing STREAM_CTRL_GET_DVD_INFO. This is extremely specific to DVD, so it's not worth abstracting this further. This is a preparation for turning the cache into an actual stream, which simply wraps the cached stream. There are other streams which are accessed in the way DVD was, at least TV/radio/DVB. We assume these can't be used with the cache. The code doesn't look thread-safe or fork aware.
* | audio/out: remove ao->outburst/buffersize fieldswm42013-06-163-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core didn't use these fields, and use of them was inconsistent accross AOs. Some didn't use them at all. Some only set them; the values were completely unused by the core. Some made full use of them. Remove these fields. In places where they are still needed, make them private AO state. Remove the --abs option. It set the buffer size for ao_oss and ao_dsound (being ignored by all other AOs), and was already marked as obsolete. If it turns out that it's still needed for ao_oss or ao_dsound, their default buffer sizes could be adjusted, and if even that doesn't help, AO suboptions could be added in these cases.
* | core: add a spsc ringbuffer implementationStefano Pigozzi2013-06-163-0/+303
| | | | | | | | | | | | |