Commit Graph

59 Commits

Author SHA1 Message Date
wm4 23a7257cca Revert "Remove DVD and Bluray support"
This reverts commit 4b93210e0c.

*shrug*
2014-07-15 01:49:02 +02:00
wm4 4b93210e0c Remove DVD and Bluray support
It never worked well. Just remux your DVD and BD images to mkv.
2014-07-14 14:34:14 +02:00
wm4 1d55547adf stream: remove now unused STREAM_CTRL_GET_START_TIME
demux_disc.c takes care of this now.
2014-07-06 19:02:33 +02:00
wm4 338004bcfc dvd, bluray, cdda: add demux_disc containing all related hacks
DVD and Bluray (and to some extent cdda) require awful hacks all over
the codebase to make them work. The main reason is that they act like
container, but are entirely implemented on the stream layer. The raw
mpeg data resulting from these streams must be "extended" with the
container-like metadata transported via STREAM_CTRLs. The result were
hacks all over demux.c and some higher-level parts.

Add a "disc" pseudo-demuxer, and move all these hacks and special-cases
to it.
2014-07-05 17:07:15 +02:00
wm4 58b8a10bab stream_bluray: fix some const declarations
Like in commit 99f5fe.
2014-06-12 00:55:13 +02:00
wm4 35e6d1abe0 stream_dvd, stream_dvdnav, stream_bluray: remove global option variables 2014-06-11 00:39:06 +02:00
wm4 aa87c143cb stream: remove chaos related to writeable streams
For some reason, we support writeable streams. (Only encoding uses that,
and the use of it looks messy enough that I want to replace it with FILE
or avio today.)

It's a chaos: most streams do not actually check the mode parameter like
they should. Simplify it, and let streams signal availability of write
mode by setting a flag in the stream info struct.
2014-05-24 16:17:52 +02:00
wm4 a4d487f5b2 stream: don't use end_pos
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.
2014-05-24 16:17:51 +02:00
wm4 ca7d8681fb stream_bluray: remove unused variables
They were used for printing slave mode stuff, which was recently
removed.
2014-05-04 13:13:31 +02:00
Martin Herkt 48bd03dd91 options: remove deprecated --identify
Also remove MSGL_SMODE and friends.

Note: The indent in options.rst was added to work around a bug in
ReportLab that causes the PDF manual build to fail.
2014-05-04 02:46:11 +02:00
wm4 1bc17a4fb8 stream_bluray: move lookup of AACS error codes into a function
Mostly a cosmetic change. Makes the code a little bit shorter.
2014-03-30 08:57:14 +02:00
xylosper c2bd34cfce stream_bluray: check AACS and BD+ protections
There are two kind of encryption for Blu-ray disc, AACS and BD+,
and both of them can be checked through BLURAY_DISC_INFO object.
This commit makes the bluray and bdnav streams refuse playback
if AACS/BD+ is detected and decryption is failed.
2014-03-30 08:51:43 +02:00
xylosper fb47f2f940 player: rename dvdnav to discnav
Now, navigation works both of DVD and non-BD-J Blu-ray. Therefore,
rename all 'dvdnav' strings which are not DVD specific to 'discnav'
2014-03-30 11:42:49 +09:00
xylosper f2088c73e3 stream_bluray: cosmetic refactoring
Remove unused variables. Declare variables when they are needed.
Adjust brackets for mpv's convention. Clean up too many empty lines.
2014-03-30 11:16:32 +09:00
xylosper a78ac37aa9 stream_bluray: select initial angle only if peeking title succeeded
The angles should be set and queried only if a valid title is
selected. Also, in navigation mode, there are some limitations
which make it impossible to query current title/angle.
2014-03-30 11:13:46 +09:00
xylosper 9946b8d4dd stream_bluray: use more proper error code for stream control
Use STREAM_OK instead of hardcoded value 1.
Handle failure of setting title as an unsupported behaviour rather
than an error.
2014-03-30 10:01:43 +09:00
xylosper 8cee8279ad stream_bluray: implement navigation interface for Blu-ray stream
This commit introduces new stream protocols: bdnav(and others).
bdnav stream shares lots of codes with original bluray stream, so
it's not separated in different source file.

Major difference from bluray is that bdnav does not support longest
title because there is no way to query that information.
bdnav://menu and bdnav://first correspond to top menu title and
first play title respectively, though they often point same title.

Also, binary position based seeking has been removed, because it
didn't have no point.
2014-03-29 23:31:46 +09:00
wm4 e8d952c807 stream_bluray: remove BD_EVENT_IDLE
This was actually supposed to be removed with pull reuqest #671, but
I accidentally re-added it with a rebasing mistake.

This probably also coincidentally fixes compilation with older
libbluray (issue #672).
2014-03-26 23:34:52 +01:00
xylosper facba0b317 stream_bluray: use bd_get_playlist_info()
Use bd_get_playlist_info() instead of bd_get_title_info(). The
previous implementation couldn't query current playlist and this
made it impossible to call bd_get_playlist_info() which is more
desirable than bd_get_title_info() because, for Blu-rays, playlist
is the unit of playback not title. This commit fixes that.
2014-03-26 21:00:48 +01:00
xylosper 6c947c64a1 stream_bluray: cache current playback informations
The cost of calling bd_get_title_info() is quite expensive and
requires lots of CPU usage. Using BD_EVENT_PLAYLIST and
BD_EVENT_TITLE, it's possible to cache BLURAY_TITLE_INFO object for
current title and BD_EVENT_ANGLE handler caches current angle. In
my test case, with this commit, CPU usage can be saved about 15-20%.
2014-03-26 21:00:48 +01:00
xylosper 4086a09695 stream_bluray: implement event handler for libbluray
This commit brings libbluray's event queue into stream_bluray.

Signed-off-by: wm4 <wm4@nowhere>
2014-03-26 21:00:47 +01:00
wm4 2c693a4732 stream: remove old chapter handling code
Stream-level chapters (like DVD etc.) did potentially not have
timestamps for each chapter, so STREAM_CTRL_SEEK_TO_CHAPTER and
STREAM_CTRL_GET_CURRENT_CHAPTER were needed to navigate chapters. We've
switched everything to use timestamps and that seems to work, so we can
simplify the code and remove this old mechanism.
2014-03-25 01:38:18 +01:00
xylosper 99044308b5 stream_bluray: fix for significant memory leak
It's obvious but, since STREAM_CTRL_GET_TIME_LENGTH is called
frequently, the amount of leaked memory here is quite big.
2014-03-24 21:50:04 +09:00
xylosper 56b0762256 stream_bluray: fix for zero-based title index for Blu-ray
The title for stream_bluray DID start from 1 and I misunderstood
that it started from 0 because mpv accepted bd://0 as a proper
argument. In fact, 0 title was an alias for the longest title but
it was not handled as a special value. This commit fixes these
behavious. 'disc-title' property for Blu-ray now starts from 0 and
the default title can be specified by 'longest' title just like
stream_dvdnav: bd://longest. Of course, 'longest' can be omitted.
2014-03-18 15:24:53 +01:00
xylosper d2e35b2faa command: make 'disc-title' property writable
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.
2014-03-18 15:24:45 +01:00
xylosper 2f72eecd89 command: set 'media-title' property for bluray disc with meta-data 2014-03-13 14:36:20 +01:00
wm4 5196b03fb2 player: avoid stalling when starting a network stream
Starting a network stream could stall by executing uncacheable stream
control requests (STREAM_CTRL_GET_LANG and STREAM_CTRL_GET_DVD_INFO).
Being uncacheable means the player has to wait until the cache is done
reading the current block of data. These requests can't be cached
because they're too complicated, so the only way to avoid them is
special casing the DVD and Bluray streams (which are the only things
which need these requests), and not doing them in other cases.

(This is kind of inelegant, but so is the rest of the DVD/BD code.)
2014-01-14 22:24:07 +01:00
wm4 0335011f11 stream: mp_msg conversions
We also drop some slave mode stuff from stream_vcd.
2013-12-21 21:43:16 +01:00
wm4 2c08bf1bd7 Reduce recursive config.h inclusions in headers
In my opinion, config.h inclusions should be kept to a minimum. MPlayer
code really liked including config.h everywhere, though, even in often
used header files. Try to reduce this.
2013-12-18 17:12:21 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
wm4 eb15151705 Move options/config related files from mpvcore/ to options/
Since m_option.h and options.h are extremely often included, a lot of
files have to be changed.

Moving path.c/h to options/ is a bit questionable, but since this is
mainly about access to config files (which are also handled in
options/), it's probably ok.
2013-12-17 02:07:57 +01:00
wm4 7dc7b900c6 Replace mp_tmsg, mp_dbg -> mp_msg, remove mp_gtext(), remove set_osd_tmsg
The tmsg stuff was for the internal gettext() based translation system,
which nobody ever attempted to use and thus was removed. mp_gtext() and
set_osd_tmsg() were also for this.

mp_dbg was once enabled in debug mode only, but since we have log level
for enabling debug messages, it seems utterly useless.
2013-12-16 20:41:08 +01:00
wm4 f99aff1b31 Reduce stheader.h includes, move stream types to mp_common.h 2013-11-23 22:08:42 +01:00
wm4 c9a740fccd stream_bluray: return number of titles
So that the "titles" property returns the number of titles.
2013-09-10 15:39:48 +02:00
wm4 971e8456fc stream: fix url_options field, make protocols field not fixed length
The way the url_options field was handled was not entirely sane: it's
actually a flexible array member, so it points to garbage for streams
which do not initialize this member (it just points to the data right
after the struct, which is garbage in theory and practice). This was
not actually a problem, since the field is only used if priv_size is
set (due to how this stuff is used). But it doesn't allow setting
priv_size only, which might be useful in some cases.

Also, make the protocols array not a fixed size array. Most stream
implementations have only 1 protocol prefix, but stream_lavf.c has
over 10 (whitelists ffmpeg protocols). The high size of the fixed
size protocol array wastes space, and it is _still_ annoying to
add new prefixes to stream_lavf (have to bump the maximum length),
so make it arbitrary length.

The two changes (plus some more cosmetic changes) arte conflated into
one, because it was annoying going over all the stream implementations.
2013-08-26 10:09:45 +02:00
wm4 f806e268c6 stream: don't require streams to set s->pos in seek callback
Instead, set s->pos depending on the success of the seek callback.
2013-08-22 19:14:26 +02:00
Noble Huang 1ef239a499 stream_bluray: fix bd:// url segfault introduced by commit bc1d61 2013-08-12 19:00:39 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
wm4 bc1d61cf42 stream: redo URL parsing, replace m_struct usage with m_config
Move the URL parsing code from m_option.c to stream.c, and simplify it
dramatically. This code originates from times when http code used this,
but now it's just relict from other stream implementations reusing this
code. Remove the unused bits and simplify the rest.

stream_vcd is insane, and the priv struct is different on every
platform, so drop the URL parsing. This means you can't specify a track
anymore, only the device. (Does anyone use stream_vcd? Not like this
couldn't be fixed, but it doesn't seem worth the effort, especially
because it'd require potentially touching platform specific code.)
2013-08-02 17:02:34 +02:00
wm4 f406482d84 stream: remove useless author/comment fields
These were printed only with -v. Most streams had them set to useless
or redundant values, so it's just badly maintained bloat.

Since we remove the "author" field too, and since this may have
copyright implications, we add the contents of the author fields to
the file headers, except if the name is already part of the file header.
2013-07-12 22:16:27 +02:00
wm4 5c1b8d4aa1 stream: don't require streams to set a type
Set the type only for streams that have special treatment in other parts
of the code.
2013-07-12 22:16:26 +02:00
wm4 cb45b1c65b Cleanup some include statements 2013-07-12 22:16:26 +02:00
wm4 52c3eb6976 core: change open_stream and demux_open signature
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.
2013-07-12 21:56:40 +02:00
wm4 c4f83ac6e9 stream: remove weird STREAMTYPE_STREAM special handling
This was an old leftover from an earlier cleanup (which happened in
2003), and which used "special" stuff for streams that could be only
forward-seeked.

Also, don't add mode flags to s->flags; they're supposed to be in
s->mode instead.
2013-07-07 21:10:44 +02:00
wm4 62786c0c91 stream_bluray: report chapter times
This was forgotten in commit 7294303.
2013-05-09 18:49:16 +02:00
wm4 729430387c stream_bluray: general timeline support
Uses the same mechanisms as stream_dvd to report the virtual playback
time as known by libdvdread/libbluray, instead of the raw demuxer
output.

This should solve many problems with BD playback, like correct display
of playback time and duration.

On the other hand, this causes some new problems. For example, the
reported stream time has a rather low resolution (1-2 seconds), so
doing precise seeking on it is near impossible.
2013-05-09 01:16:04 +02:00
wm4 2dde1af88d stream_bluray: make code a bit more obvious 2013-05-09 01:16:04 +02:00
reimar daee1a04e7 stream_bluray: remove the broken -bluray-chapter option
Remove the broken -bluray-chapter option.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2

Conflicts:
	DOCS/man/en/mplayer.1
	cfg-common.h
2013-04-27 15:28:57 +02:00
reimar 2f004875d3 stream_bluray: fix querying current chapter
br://: Fix querying current chapter.

This also fixes specifying an end chapter via -chapter.
Based on patch by Olivier Rolland [billl users.sourceforge.net]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36173 b3059339-0415-0410-9bf9-f77b7e298cf2
2013-04-27 15:28:34 +02:00
wm4 9085b85729 stream: fix dvd:// + cache crashing
The language string was dynamically allocated, which completely fails
if the cache is forked (which it usually is). Change it back to a fixed
length string, like the original code had it.
2012-11-20 18:00:15 +01:00