summaryrefslogtreecommitdiffstats
path: root/demux/demux_mf.c
Commit message (Collapse)AuthorAgeFilesLines
* demux: remove gsh field from sh_audio/sh_video/sh_subwm42013-11-231-1/+1
| | | | | | | | | This used to be needed to access the generic stream header from the specific headers, which in turn was needed because the decoders had access only to the specific headers. This is not the case anymore, so this can finally be removed again. Also move the "format" field from the specific headers to sh_stream.
* demux_mf: use tallocwm42013-11-111-19/+5
|
* demux_mf: uncrustifywm42013-11-111-97/+102
|
* demux: make determining seek capability genericwm42013-11-031-0/+1
| | | | | | | | | | | | | | | | Instead of having each demuxer do it (only demux_mkv actually did...), let generic code determine whether the file is seekable. This requires adding exceptions to demuxers where the stream is not seekable, but the demuxer is. Sort-of try to improve handling of unseekable files in the player. Exit early if the file is determined to be unseekable, instead of resetting all decoders and then performing a pointless seek. Add an exception to allow seeking if the file is not seekable, but the stream cache is enabled. Print a warning in this case, because seeking outside the cache (which we can't prevent since the demuxer is not aware of this problem) still messes everything up.
* demux: remove movi_start/movi_end fieldswm42013-11-031-4/+0
| | | | | | | Pointless, using stream->start_pos/end_pos instead. demux_mf was the only place where this was used specially, but we can rely on timestamps instead for this case.
* demux: remove unused audio_delay parameter from demux_seek()wm42013-08-221-1/+2
| | | | Used to be needed by demux_avi.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-1/+1
| | | | Followup commit. Fixes all the files references.
* demux: assume correct-pts mode by defaultwm42013-07-121-3/+0
| | | | | | | | All demuxers make a reasonable effort to set packet timestamps, and thus support correct-pts mode. This commit also implicitly switches demux_rawvideo to correct-pts mode. We still allow demuxers to disable correct-pts mode in theory.
* demux: remove useless author/comment fieldswm42013-07-121-4/+1
| | | | Same deal as with previous commit.
* demux: rewrite probing and demuxer initializationwm42013-07-121-45/+32
| | | | | | | | | | | | | | Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants. Instead of having two open functions for the demuxer callbacks (which somehow are both optional, but you can also decide to implement both...), just have one function. This function takes a parameter that tells the demuxer how strictly it should check for the file headers. This is a nice simplification and allows more flexibility. Remove the file extension code. This literally did nothing (anymore). Change demux_lavf so that we check our other builtin demuxers first before libavformat tries to guess by file extension.
* core: change open_stream and demux_open signaturewm42013-07-121-1/+1
| | | | | | | | | | | This removes the dependency on DEMUXER_TYPE_* and the file_format parameter from the stream open functions. Remove some of the playlist handling code. It looks like this was needed only for loading linked mov files with demux_mov (which was removed long ago). Delete a minor bit of dead network-related code from stream.c as well.
* demux: change signature of open functions, cleanupswm42013-07-111-18/+19
| | | | Preparation for redoing the open functions.
* video: eliminate frametime variablewm42013-07-111-1/+0
|
* core: don't access demux_stream outside of demux.c, make it privatewm42013-07-111-7/+3
| | | | | | | | | | | | | | | | | | | Generally remove all accesses to demux_stream from all the code, except inside of demux.c. Make it completely private to demux.c. This simplifies the code because it removes an extra concept. In demux.c it is reduced to a simple packet queue. There were other uses of demux_stream, but they were removed or are removed with this commit. Remove the extra "ds" argument to demux fill_buffer callback. It was used by demux_avi and the TV pseudo-demuxer only. Remove usage of d_video->last_pts from the no-correct-pts code. This field contains the last PTS retrieved after a packet that is not NOPTS. We can easily get this value manually because we read the packets ourselves. Reuse sh_video->last_pts to store the packet PTS values. It was used only by the correct-pts code before, and like d_video->last_pts, it is reset on seek. The behavior should be exactly the same.
* demux: remove separate arrays for audio/video/sub streams, simplifywm42013-07-081-3/+0
| | | | | | | | | | | | These separate arrays were used by the old demuxers and are not needed anymore. We can simplify track switching as well. One interesting thing is that stream/tv.c (which is a demuxer) won't respect --no-audio anymore. It will probably work as expected, but it will still open an audio device etc. - this is because track selection is now always done with the runtime track switching mechanism. Maybe the TV code could be updated to do proper runtime switching, but I can't test this stuff.
* demux: remove some old stream header functionswm42013-07-081-1/+2
|
* stream: remove padding parameter from stream_read_complete()wm42013-06-231-1/+1
| | | | | | | | 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.
* demux_mf: fix crashes when '*' matches directorieswm42013-03-191-3/+6
| | | | | | | Doing 'mpv mf://*' in a file with directories would crash, because even though directories are skipped, the corresponding file entry is just left at NULL, leading to a segfault on access. So explicitly skip NULL entries.
* core: use playback time to determine playback percent positionwm42013-02-261-6/+0
| | | | | | | | | | | | | The percent position is used for the OSD, the status line, and for the OSD bar (shown on seeks). By default, the PTS of the last demuxed packet was used to calculate it. This led to a "jumpy" display when the percentage value (casted to int) was changing. The reasons for this were the presence of video frame reordering (packet PTS is not monotonic), or getting PTS values from different streams (like audio/subs). Since these rely on PTS values and correct file durations anyway, simplify it by calculating it with the current playback position in mplayer.c instead.
* demux_mf: add some more image formatswm42013-02-241-1/+15
| | | | And fix the comment about fourccs.
* demux_mf: support .xbmwm42013-02-241-0/+1
| | | | | | | And support the PIX_FMT_MONOWHITE pixel format. (This is really weird: unlike PIX_FMT_MONOBLACK, it uses white pixels. I have no idea why libavcodec doesn't just convert the pixel format on the fly, instead of bothering everyone with really special pixel formats.)
* demux_mf: map to codecs directlywm42013-02-241-36/+35
| | | | Instead of going through FourCCs and codec_tags.c.
* demux_mf: fix breakage after commit 4d016a9wm42013-02-171-0/+1
|
* demux_mf: allow displaying single image files, various cleanupswm42012-11-161-76/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable autoprobing for demux_mf, so that image files can be directly displayed with e.g. "mpv file.jpg --pause". (The --pause switch is needed to prevent the window from closing immediately.) Since demux_mf doesn't have any real file format probing and goes by file extension only, move the demuxer down the demuxer list to ensure it's checked last. (ffmpeg's demux_mf equivalent, "image2", probes by file extensions too, and there doesn't seem to be anything that can probe typical image file formats from binary data.) Remove the --mf "w" and "h" suboptions. Don't pass the width/height to the video stream header. Both of these are useless, because the decoder reads the real image size at a later point from the file headers. Remove setting the BITMAPINFOHEADER as well, as vd_lavc doesn't need this. Enable --correct-pts by default. This fixes displaying a single image with vo_vdpau (as mentioned by uau). Keep around a pointer to the sh_video stream header instead of accessing demuxer->video->sh_video. Fixes a crash when deselecting the video track. Note that the format probing is incorrect when opening images from HTTP locations. File extensions don't have to match the actual file format. A correct implementation would require to check the MIME type, or to probe the binary data correctly.
* Rename directories, move files (step 2 of 2)wm42012-11-121-2/+2
| | | | | | | | | | | | Finish renaming directories and moving files. Adjust all include statements to make the previous commit compile. The two commits are separate, because git is bad at tracking renames and content changes at the same time. Also take this as an opportunity to remove the separation between "common" and "mplayer" sources in the Makefile. ("common" used to be shared between mplayer and mencoder.)
* Rename directories, move files (step 1 of 2) (does not compile)wm42012-11-121-0/+226
Tis drops the silly lib prefixes, and attempts to organize the tree in a more logical way. Make the top-level directory less cluttered as well. Renames the following directories: libaf -> audio/filter libao2 -> audio/out libvo -> video/out libmpdemux -> demux Split libmpcodecs: vf* -> video/filter vd*, dec_video.* -> video/decode mp_image*, img_format*, ... -> video/ ad*, dec_audio.* -> audio/decode libaf/format.* is moved to audio/ - this is similar to how mp_image.* is located in video/. Move most top-level .c/.h files to core. (talloc.c/.h is left on top- level, because it's external.) Park some of the more annoying files in compat/. Some of these are relicts from the time mplayer used ffmpeg internals. sub/ is not split, because it's too much of a mess (subtitle code is mixed with OSD display and rendering). Maybe the organization of core is not ideal: it mixes playback core (like mplayer.c) and utility helpers (like bstr.c/h). Should the need arise, the playback core will be moved somewhere else, while core contains all helper and common code.