Commit Graph

67 Commits

Author SHA1 Message Date
Miro Hrončok c31ce789c5 stream_radio: suppress error with -Werror=format-security compilation flag
Signed-off-by: wm4 <wm4@nowhere>
2013-12-22 21:00:15 +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 3dbc9007b0 demux: mp_msg conversions
The TV code pretends to be part of stream/, but it's actually demuxer
code too. The audio_in code is shared between the TV code and
stream_radio.c, so stream_radio.c needs a small hack until stream.c is
converted.
2013-12-21 21:43:16 +01:00
wm4 4ed83fe2e5 Remove the _ macro
This was a gettext-style macro to mark strings that should be
translated.
2013-12-18 17:12:07 +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 95cfe58e3d Use O_CLOEXEC when creating FDs
This is needed so that new processes (created with fork+exec) don't
inherit open files, which can be important for a number of reasons.

Since O_CLOEXEC is relatively new (POSIX.1-2008, before that Linux
specific), we #define it to 0 in io.h to prevent compilation errors on
older/crappy systems. At least this is the plan.

input.c creates a pipe. For that, add a mp_set_cloexec() function (which
is based on Weston's code in vo_wayland.c, but more correct). We could
use pipe2() instead, but that is Linux specific. Technically, we have a
race condition, but it won't matter.
2013-11-30 22:40:51 +01:00
wm4 f99aff1b31 Reduce stheader.h includes, move stream types to mp_common.h 2013-11-23 22:08:42 +01:00
wm4 05e2b1f513 stream: don't include linux/types.h in some files
Apparently this is not portable to FreeBSD. It turns out that we
(probably) don't use any symbols defined by this header directly, so
the includes are not needed.
2013-11-13 20:59:50 +01:00
Stefano Pigozzi 37388ebb0e configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy
always wanted to introduce a new better way to uniform it[1]. For an
hypothetic feature 'hurr' you could have had:

  * #define HAVE_HURR 1   / #undef HAVE_DURR
  * #define HAVE_HURR     / #undef HAVE_DURR
  * #define CONFIG_HURR 1 / #undef CONFIG_DURR
  * #define HAVE_HURR 1   / #define HAVE_DURR 0
  * #define CONFIG_HURR 1 / #define CONFIG_DURR 0

All is now uniform and uses:
  * #define HAVE_HURR 1
  * #define HAVE_DURR 0

We like definining to 0 as opposed to `undef` bcause it can help spot typos
and is very helpful when doing big reorganizations in the code.

[1]: http://xkcd.com/927/ related
2013-11-03 21:59:54 +01: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
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 3be39ed76c stream_radio: fix some things
Using the radio set/step channel commands would have crashed (that was
broken for about a year, nobody ever noticed). The "capture" part of
a radio:// URI was incorrectly passed (this was broken quite recently).

Still couldn't test it fully. I have no radio device. I suspect nobody
uses this feature or will ever use it again.
2013-08-05 19:18:22 +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 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 f2ad12a819 stream_radio: fix build
This was accidentally broken with 37c5c11 and has been nroken for
5 months.

Does anyone (want to) use this at all?
2013-07-08 03:19:46 +02:00
wm4 7c4202b863 cache: make the stream cache a proper stream that wraps other streams
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.
2013-06-16 22:05:09 +02:00
wm4 37c5c114af Remove BSD legacy TV/radio support (BT848 stuff)
FreeBSD actually supports V4L2, and V4L2 supports this chip. Also,
this chip is from 1997. Farewell.
2013-02-06 23:03:39 +01:00
wm4 4873b32c59 Rename directories, move files (step 2 of 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.)
2012-11-12 20:08:18 +01:00
wm4 2aef9e2ef3 stream: remove V4L TV input and V4L radio support
There are V4L2 drivers, and the old V4L stuff seems plain unnecessary.
2012-08-02 23:51:54 +02:00
diego 12d3e0df99 cleanup: don't check for NULL before free()
patch by Clément Bœsch, ubitux gmail com

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-08 18:05:12 +02:00
diego ed8e92afcc Remove #warning preprocessor directives
The #warning preprocessor directive is non-standard and not available with all
compilers. Furthermore, the warnings it causes are noisy and have not led to
getting any of the underlying issues fixed in the space of a decade.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32480 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:10 +02:00
Uoti Urpala 2120eb5998 stream_radio.c: fix corrupt line from e3061749 2010-06-02 00:27:01 +03:00
Uoti Urpala 00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
Amar Takhar e306174952 Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
2009-07-07 01:38:20 +03:00
Amar Takhar b5972d6f14 Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
2009-07-07 01:28:07 +03:00
Uoti Urpala 17d3e4b36d Merge svn changes up to r27441
Conflicts:

	cfg-common-opts.h
	command.c
	configure
	input/input.c
	libmpcodecs/dec_video.c
	libmpcodecs/vd.c
	libmpdemux/stheader.h
	libvo/sub.c
	libvo/video_out.c
	libvo/vo_xv.c
	libvo/vosub_vidix.c
	libvo/x11_common.c
	libvo/x11_common.h
	mp_core.h
	mplayer.c
	stream/stream.h
2008-08-08 02:13:09 +03:00
diego 024b6efdf1 Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
Use it in all the places that checked for either ALSA 0.9 or 1.x.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27422 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-06 23:19:29 +00:00
diego f83e779ee4 Rename some audio-output-related preprocessor directives.
Switch them from a HAVE_ prefix to a CONFIG_ prefix.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27419 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-05 16:32:47 +00:00
diego 02135001b4 Change a bunch of video/audio-output-specific preprocessor directives from
a HAVE_ prefix to a CONFIG_ prefix.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27402 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-03 15:21:40 +00:00
Uoti Urpala 04f3909a72 Merge svn changes up to r27374
Conflicts:

	cfg-common-opts.h
	cfg-mplayer.h
	command.c
	configure
	libmpcodecs/dec_video.c
	libmpcodecs/vd.c
	libmpcodecs/vf_vo.c
	libmpdemux/demuxer.h
	libmpdemux/stheader.h
	mp_core.h
	mplayer.c
	stream/stream_radio.c
2008-07-30 16:39:24 +03:00
diego 4b141479da Start unifying names of internal preprocessor directives.
Replace all USE_ prefixes by CONFIG_ prefixes to indicate
options which are configurable.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27373 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-07-30 12:01:30 +00:00
Uoti Urpala a41db36b22 Merge svn changes up to r26783
Conflicts:

	Makefile
	common.mak
	configure
	libmpcodecs/vd_ffmpeg.c
	libmpdemux/demux_mkv.c
	libvo/vo_xv.c
	mplayer.c
2008-05-15 21:19:35 +03:00
diego 0ecfcdce00 Use standard license headers with standard formatting.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26769 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-14 17:20:42 +00:00
Uoti Urpala 0e757bf9da Remove _s/_st suffix from some struct names
Since the names are always used after the keyword "struct" having a
suffix as in "struct demuxer_st" is almost completely pointless.
2008-04-25 03:34:22 +03:00
diego 835c654bb0 typo fix: inited --> initialized
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25994 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-02-14 14:23:55 +00:00
reimar 6f616c316d stream_opts should be const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25719 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-13 12:34:42 +00:00
reimar dd2fcb4370 stream_opts arrays should be const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25270 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-02 21:37:08 +00:00
reimar cd3d3369e1 Mark all stream_info_t as const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25239 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-02 13:22:53 +00:00
voroshil 31d2ed32a6 Don't wait for filling entire audio ringbuffer at each call to grab_audio_frame.
Fixes 2 minutes delay before starting playback and audio clicks in sound
(at least for my SAA7134 based card while capturing radio through saa7134-alsa
module).


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24849 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-25 15:04:33 +00:00
voroshil f7e755eb55 Add missing call to audio_in_start_capture.
Fixes capturing sound from ALSA devices
(repeated xrun errors, buffer underruns and son on).



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24848 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-25 14:57:17 +00:00
voroshil 2312ca9e70 Fix compilation with enabled radio capture and disabled OSS audio.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24603 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-24 16:48:08 +00:00
diego 01d92a32ad cosmetics: typo fix UNSUPORTED --> UNSUPPORTED
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24277 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-28 22:38:45 +00:00
cehoyos 9e9a76fd38 Fix warning: too many arguments for format
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24039 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-08 22:30:51 +00:00
voroshil 61bce335f7 Replacing global variables in radio:// with
context-sensitive structure.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23910 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-29 12:20:25 +00:00
reimar 4c4a1070fe Avoid code duplication and ugly config.h hack by using av_strlcat/av_strlcpy
instead of plain strlcat/strlcpy


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23723 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-05 22:01:07 +00:00
voroshil f619fb233b Fix compiler warnings.
Remove unused tv_param_on variable.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23505 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-08 06:08:51 +00:00