Commit Graph

51 Commits

Author SHA1 Message Date
wm4 885c6a2610 Fix some cppcheck / scan-build warnings
These were found by the cppcheck and scan-build static analyzers. Most
of these aren't interesting (the 2 previous commits fix some interesting
cases found by these analyzers), and they don't nearly fix all warnings.
(Most of the unfixed warnings are spam, things MPlayer never cared
about, or false positives.)
2013-05-06 23:11:11 +02:00
wm4 8751a0e261 video: decouple internal pixel formats from FourCCs
mplayer's video chain traditionally used FourCCs for pixel formats. For
example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the
string 'YV12' interpreted as unsigned int. Additionally, it used to
encode information into the numeric values of some formats. The RGB
formats had their bit depth and endian encoded into the least
significant byte. Extended planar formats (420P10 etc.) had chroma
shift, endian, and component bit depth encoded. (This has been removed
in recent commits.)

Replace the FourCC mess with a simple enum. Remove all the redundant
formats like YV12/I420/IYUV. Replace some image format names by
something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P.

Add img_fourcc.h, which contains the old IDs for code that actually uses
FourCCs. Change the way demuxers, that output raw video, identify the
video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to
request the rawvideo decoder, and sh_video->imgfmt specifies the pixel
format. Like the previous hack, this is supposed to avoid the need for
a complete codecs.cfg entry per format, or other lookup tables. (Note
that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT
raw video, but this is still considered better than adding a raw video
decoder - even if trivial, it would be full of annoying lookup tables.)

The TV code has not been tested.

Some corrective changes regarding endian and other image format flags
creep in.
2013-01-13 20:04:11 +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 cafa00841f libaf: rename af_format.h to format.h
af_format.h declares some symbols which are defined in format.c. The
fact that af_format.c is a completely unrelated file is rather
confusing. Having the header and implementation file use the same base
name is more uniform. (af_format.c is the audio conversion filter, while
af_format.h and format.c are about audio formats and their properties.)

Also fix all source files which include this file.
2012-08-29 00:50:26 +02:00
wm4 ebaaa41f2a Remove teletext support
Teletext requires special OSD support. Because I can't even test
teletext, I can't restore support for it. Since teletext can be
considered ancient and obscure, and since it doesn't make sense to keep
the remaining teletext code without being able to use it, I'm removing
it.
2012-08-03 00:12:46 +02:00
iive 860e66818b stream/tvi_v4l[2]: fix calculation of free RAM for buffers
Do a proper calculation of free RAM to be used as V4L buffers.
The code uses sysinfo to query the available RAM, however it used
ancient form available in some early development 2.3.x kernels.
Newer form reports the size in memory units (usually same as page size),
as result the code would fall back on 2 buffers even on multi GB system.

The commit does: Improve the check in configure to ensure that we
do use sysinfo struct with present mem_unit. Use free RAM instead of
total RAM (to avoid swapping). Tweak memory constants and simplify code.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33732 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-07-06 13:01:08 +03:00
Uoti Urpala 2d187f9750 stream/tvi_v4l2: Add V4L2 support for OpenBSD (and NetBSD)
Patch by Brad <brad@comstyle.com>.
2011-06-29 07:23:24 +03:00
reimar 23fdd9463c stream/tvi_v4l2.c: simplify by using getfps helper function
Use getfps helper function everywhere, simplifies code and avoids a
possible division by 0.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32755 b3059339-0415-0410-9bf9-f77b7e298cf2
2011-01-31 16:03:10 +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
reimar db90a65d11 Remove remaining %lf printf conversions
Most cases are just code in comments.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32438 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:18:08 +02:00
diego 8939645dcf stream/tv: move new_handle() function from header to tv.c
Move TV input new_handle static function to tv.c and make it non-static.
There is no need to duplicate the function in the binary.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32225 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:55 +02:00
diego a64cd8d3c8 stream/tv: move free_handle() from header to tv.c
Move TV input free_handle static function to tv.c and make it non-static.
There is no need to duplicate the function in the binary.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32174 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:16:46 +02:00
siretart 2e6ff523dd spelling fixes
Found by the Debian QA tool 'lintian'

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

reintroduce typo in genres.h that was fixed fixed r31913 to match the id3v2 spec

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31920 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-11-02 04:15:03 +02:00
reimar 7bc5b0253f tv.h: Change function pointer types to proper declarations
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31388 b3059339-0415-0410-9bf9-f77b7e298cf2

Note that the code is still questionable after this commit - the
shared data structure has pointers to "struct priv", but different
files use different incompatible definitions for that struct.
2010-11-02 04:07:42 +02:00
reimar e58e467c56 100l, fix check for V4L2 capture capability flag.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29991 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-12-11 21:33:57 +00:00
cehoyos 2a5611473c Remove CONFIG_TV_TELETEXT.
DVB teletext support is nearly finished, it will be possible to read
teletext from file, it will not be depending on reception any more.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29851 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-07 16:40:42 +00:00
cehoyos 423c415534 Separate teletext from tv support.
Path by Francesco Lavra, francescolavra interfree it


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29848 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-07 12:31:05 +00:00
cehoyos 9df11ee8bf Add MSGT_TELETEXT, rename TVI_CONTROL as VBI_CONTROL and fix some paths
in comments.

Based on a patch by Francesco Lavra, francescolavra interfree it


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29802 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-10-29 22:39:00 +00:00
cehoyos a9474b0b39 Move teletext specific code from stream into libmpcodecs.
Patch by Francesco Lavra, francescolavra interfree it


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29801 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-10-29 22:13:04 +00:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
reimar b6225fc8ae Make tvi_v4l2 print -1 as "Current input" if the ioctl to read it failed.
Previously it printed (number of inputs + 1) which is needlessly confusing.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29161 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-04-10 10:13:41 +00:00
reimar b397b28b31 Add TVI_CONTROL_VID_SET_WIDTH_HEIGHT to set width and height together for v4l2,
otherwise some drivers will always stay stuck in the lowest resolution.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28975 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-16 17:12:29 +00:00
reimar 37c6f0d36c 100l fix calculation of dropped frames, number of frames is time * fps, not time / fps.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28962 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-15 16:12:05 +00:00
diego 39090878e5 Replace informal GPL notes by standard GPL header.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28140 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-12-13 12:13:48 +00:00
diego 3af860b877 Rename HAVE_WINSOCK preprocessor condition to HAVE_WINSOCK_H.
This is what it is called in FFmpeg and more consistent with other
names for similar conditionals. This fixes a potential compilation
failure on MinGW, as described in Bugzilla #1262.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27493 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-29 20:05:08 +00: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
voroshil 6077530ac2 Try to get frame rate information through VIDIOC_G_PARM if
capture device driver (such as uvcvideo USB video driver) does
not provide VIDIOC_G_STD ioctl.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27171 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-06-30 17:46:27 +00:00
voroshil fddbd84992 Fix division by zero in tvi_v4l2 which occures when capture device
driver (such as uvcvideo USB video driver) does not provide VIDIOC_G_STD ioctl.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27170 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-06-30 17:42:35 +00:00
diego c657594049 cosmetics: Remove useless parentheses from return statements.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26788 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-16 08:43:15 +00: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 83773af50f Make all tvi_info_t const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25717 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-01-13 12:01:57 +00:00
voroshil 70ca379c4c Add missing call to audio_in_uninit in v4l2 tv driver.
Without it, tv does not start on the second run when using mplayer in slave or idle mode.

Patch by Stanislaw Jesmanowicz stan at jesmanowicz dot com



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25033 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-11-13 11:34:45 +00:00
voroshil 39e5906704 After receiving EINTR 'read' syscall should be restarted.
Fixes receiving teletext on some systems.

Modified patch from Oldrich Jedlicka oldium dot pro at aenam dot cz



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24791 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-10-16 01:53:34 +00:00
voroshil fdb78c2bea Implement setting gain control for video devices (usually webcams)
in v4l2 tv:// driver.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24573 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-18 16:28:39 +00:00
voroshil 0efbf8149c Fix for:
tvi_v4l2.c: In function 'start':
tvi_v4l2.c:1453: warning: comparison between signed and unsigned


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24366 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-08 10:15:08 +00:00
voroshil f1fbca4bdd Automatic TV channels scanning ability for MPlayer.
Code is based on patch from Otvos Attila oattila at chello dot hu


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24125 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-23 16:09:30 +00:00
cehoyos 9a4832f066 Added missing newline.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23999 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-08-03 10:57:49 +00:00
voroshil 0c9c146505 Teletext support
Part 3/5: grabbing raw VBI data



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23921 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-29 17:56:47 +00:00
voroshil 3a1756d7e6 Removing global variables from tv://
Step 5: removing references to old globals from tvi_v4l2.c



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23906 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-29 10:21:48 +00:00
voroshil 7cdc5ad4fe Removing global variables from tv://
Step 2: fixing tv subdrivers initialization.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23903 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-07-29 10:18:38 +00:00
voroshil cc5ea363f8 mjpeg support for v4l2 tv:// driver
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23441 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-06-01 17:29:35 +00:00
voroshil eb5bf3b88e New "automute" tv:// option.
Will switch off sound and show blue screen instead of video with noise
when signal level (in 0-255 scale) is less than specified value.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23440 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-31 17:49:51 +00:00
voroshil 8ee842dde2 remove unnecessary stubs which were not ever used.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23380 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-05-24 09:58:57 +00:00
voroshil 43fa410db0 (cosmetics) replace tabs with spaces
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23169 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-04-29 05:17:08 +00:00
voroshil e1704a4877 tv driver loading rework. As a side effect "-tv driver=help" option is
implemented.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22399 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-03-01 18:38:00 +00:00
reimar 1f2f5a5ea9 Add missing buf.memory = V4L2_MEMORY_MMAP; initializations.
Patch by Laurent Pinchart {laurent pinchart <at> skynet be}


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21603 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-12-12 19:17:47 +00:00
henry 3a0f1fa219 changed email address
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20662 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-04 10:21:52 +00:00
diego 77b4259600 Explicitly include libmpcodecs/img_format.h and libvo/fastmemcpy.h.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19437 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-08-18 13:58:03 +00:00