Commit graph

3467 commits

Author SHA1 Message Date
Tim-Philipp Müller
d9f83ad938 dvbsuboverlay: fix atomic access 2010-12-17 10:50:36 +00:00
Janne Grunau
b73ae45460 dvbsuboverlay: fix rendering artefacts
Initialize source x position for odd height special case.
2010-12-16 15:33:59 +00:00
Edward Hervey
b191fb2b05 dvbsuboverlay: The enable property is a boolean and not an integer 2010-12-16 11:29:07 +01:00
Sebastian Dröge
2561bb8fa7 autoconvert: Rename autocolorspace to autovideoconvert
This doesn't just convert between color spaces.
2010-12-16 09:59:42 +01:00
Benjamin Gaignard
c8d9cc5770 bayer2rgb: Add framerate to the sink caps
Fixes bug #637224.
2010-12-15 21:28:06 +01:00
Benjamin Gaignard
27ac6c3e47 autocolorspace: Add autoconvert based video format convert element
Fixes bug #636106.
2010-12-15 21:14:38 +01:00
Sebastian Dröge
a99e13cd5a dvbsuboverlay: Rename DVB subtitling media type to subpicture/x-dvb 2010-12-15 21:11:29 +01:00
Sebastian Dröge
18061222b9 mpegtsdemux: Rename DVB subtitling media type to subpicture/x-dvb 2010-12-15 21:11:11 +01:00
Sebastian Dröge
a71c3f7e48 dvbsuboverlay: Don't draw anything on the video if the enable property is set to FALSE 2010-12-15 20:54:35 +01:00
Sebastian Dröge
65598884d2 dvbsuboverlay: Add #defines for the property default values 2010-12-15 20:53:21 +01:00
Sebastian Dröge
e9fa2fcd8b dvbsuboverlay: Use g_atomic_int_get() for reading the max_page_timeout field 2010-12-15 20:51:12 +01:00
Sebastian Dröge
61c2b173c6 mpegtsdemux: Mark array static const and use G_N_ELEMENTS instead of sizeof 2010-12-15 20:49:57 +01:00
Janne Grunau
431ea2c697 mpegtsdemux: add DESC_DVB_SUBTITLING descriptor for language parsing 2010-12-15 20:47:25 +01:00
Janne Grunau
eaf1b316b0 mpegtsdemux: enable gather_pes only for DVB subtitle private streams 2010-12-15 20:47:25 +01:00
Janne Grunau
9b3b1aedea dvbsuboverlay: use atomic instructions to set/get enable property 2010-12-15 20:47:25 +01:00
Janne Grunau
533453186e dvbsuboverlay: add property to limit page_time_out to a setable maximum 2010-12-15 20:47:25 +01:00
Janne Grunau
36b101cfb8 dvbsuboverlay: implement display definition segment subtitle windows
simplifies subtitle scaling in blit_i420()
2010-12-15 20:47:25 +01:00
Janne Grunau
4d8220b033 dvbsuboverlay: scale subtitles according to the display size
Display size is either transmitted in the display definition segment or
implicitly defined to 720x576. The subtitle window information also present in
the display definition segment is not yet used.
2010-12-15 20:47:25 +01:00
Janne Grunau
83a84ba230 dvbsuboverlay: implement display definition segment parsing 2010-12-15 20:47:25 +01:00
Janne Grunau
2f6f78caa3 dvbsuboverlay: fix luma stride for scaled subtitles (display width != width) 2010-12-15 20:47:24 +01:00
David Schleef
9fd41486a2 y4mdec: Add y4mdec
Feel the y4m love.  It seeks.  It works in pitivi.
2010-12-14 01:27:05 -08:00
Mark Nauwelaerts
aae382bcc6 jpegparse: avoid leaking tag event 2010-12-13 16:25:29 +01:00
Mark Nauwelaerts
01e9b677a8 ac3parse: relax bsid checking
... to the widest possible spec interpretation.

Fixes #637062.
2010-12-13 15:29:33 +01:00
Matthew Ife
51c63587a1 rfbsrc: fail more gracefully if source gets disconnected or geometry changes
Don't get caught in an infinite loop if the source gets disconnected and also
support gracefully failing upon detecting the frame geometry has increased
(rather than segfaulting).

https://bugzilla.gnome.org/show_bug.cgi?id=635397
2010-12-12 23:36:56 +00:00
Mark Nauwelaerts
2056f4a633 jpegparse: avoid leaking converted comment string 2010-12-12 22:14:59 +01:00
Sebastian Dröge
ec300d007d ssim: Set classification to Filter/Analyzer/Video instead of Filter/Converter/Video
Fixes bug #636109.
2010-12-12 12:01:38 +01:00
Jan Schmidt
a4f2ab78ff gaudieffects: Avoid divide by 0 in burn element 2010-12-12 02:24:00 +11:00
Thiago Santos
b6d5763e05 basecamerasrc: Remove ghostpads
Remove ghost pads from basecamerasrc. Different implementations
of camera sources might not use ghostpads and use default pads.
2010-12-08 15:38:30 -03:00
Thiago Santos
91d8bbd8a1 basecamerasrc: Removing ununsed methods
Remove one unused method _finish_image_capture()
2010-12-08 15:38:30 -03:00
Thiago Santos
db72d691ca camerabin2: Cleanup
Removing commented code
2010-12-08 15:38:30 -03:00
Thiago Santos
24bc280806 basecamerasrc: Move start/stop capture signals to basecamerasrc
Move start/stop signals and ready-for-capture to basecamerasrc
as this should be present on all camera sources
2010-12-08 15:38:30 -03:00
Thiago Santos
87eddd54d5 basecamerasrc: Add mode property
Move mode property from v4l2camerasrc to basecamerasrc, as all
camera sources should handle it.
2010-12-08 15:38:29 -03:00
Thiago Santos
b11342d325 camerabin2: Reset all elements on video recording branch before capture
We need to reset the elements from the video recording branch, including
the queue and capsfilter in order to clear the eos state and activate
the pads.

This makes it possible to record multiple videos with camerabin2 in a
sequence, otherwise the source would get a unexpected return and
push EOS, stopping the whole pipeline.
2010-12-08 15:38:29 -03:00
Thiago Santos
5776a17c86 camerabin2: More debug logs
Sprinkle some more debugging logs
2010-12-08 15:38:29 -03:00
Thiago Santos
122a7bd556 camerabin2: Various fixes
As video recording bin's state is locked, we should always
remember of setting it to NULL when camerabin2 goes to NULL

Be more careful when using elements that might not
have been created yet

And do not set location property recursively on videorecordingbin
2010-12-08 15:38:29 -03:00
Thiago Santos
0685b8921e viewfinderbin: Improve elements creation
Be more careful with cleanup of elements. Also add some logs and
improve docs a little.
2010-12-08 15:38:29 -03:00
Thiago Santos
19e52f35ee camerabin2: remove unused code
General cleanup, removing unused bits
2010-12-08 15:38:28 -03:00
Thiago Santos
ba878c95b2 camerabin2: adds location property
Adds a location property to enable applications to select
the captured files names. Locations are handled just like
multifilesink ones

Also disables -Wformat-nonliteral to allow to use non-literals
on g_strdup_printf on camerabin and generate a sequence of
locations for captures.
2010-12-08 15:38:28 -03:00
Thiago Santos
5b3deecab9 camerabin2: Fix set/get property function names
Add more consistency to the function names by using
gst_camera_bin as the other functions.
2010-12-08 15:38:28 -03:00
Thiago Santos
cb915196e2 camerabin2: Handle vidbin state change individually
Keep vidbin state locked to avoid it going to playing without
being used and leaving an empty file created.

Check the docs on the code for details on the handling.
2010-12-08 15:38:28 -03:00
Thiago Santos
0ae8df4312 camerabin2: Keep it under --enable-experimental
camerabin2 is still under heavy development, activate it only if
the --enable-experimental flag is on.

Also add a note to the docs.
2010-12-08 15:38:28 -03:00
Thiago Santos
5be441adff v4l2camerasrc: Add ready-for-capture property
Adds property that informs if v4l2camerasrc is available
for starting a new capture.

It is useful for applications to know (via deep-notify) when the
property changes and a new capture is possible. Note, however, that
starting a new capture from the notify callback will cause a deadlock.
2010-12-08 15:38:28 -03:00
Thiago Santos
bd89d22da9 camerabin2: Update v4l2camerasrc to use start/stop signals
Removes the old logic for v4l2camerasrc that used the mode
property switching to start/stop captures to make it identical
to camerabin2 behavior and to allow the future addition of
pausing a video recording.

This also removes the MODE_PREVIEW as it became useless.
2010-12-08 15:38:28 -03:00
Thiago Santos
b4d73cb9a8 camerabin2: Cleanup capturing flag
Cleanup capturing flag when the source switches back to the
viewfinder mode
2010-12-08 15:38:28 -03:00
Thiago Santos
9df40915d6 v4l2camerasrc: Remove unnecessary padding 2010-12-08 15:38:28 -03:00
Thiago Santos
91b7f2d99e v4l2camerasrc: Implement video capture
Implements video capture on v4l2camerasrc by using the mode property,
when mode is set to video, the pad probe pushes a new segment
and starts pushing buffers on the pad, when it the property is
sent back to preview, the pad probe pushes an EOS and stops
pushing buffers.

This is controlled by a Recording State variable, that is protected
by the GST_OBJECT_LOCK. I don't think locking for every buffer is
nice, so we could find an alternative lockless way here.
2010-12-08 15:38:28 -03:00
Thiago Santos
596422d19c v4l2camerasrc: Fix image capture
Once a image is captured, v4l2camerasrc should return to the
preview mode and stop capturing.
2010-12-08 15:38:27 -03:00
Thiago Santos
6c7d7946f5 camerabin2: Keep mode definition at -enum file
Use 'mode' enum definition from gstcamerabin-enum file to avoid
conflicts between v4l2camerasrc and gstcamerabin2 modes.

For now there is a MODE_PREVIEW there that is only used on the
camerasrc, not sure if we are keeping it at the future, but for
now this works.
2010-12-08 15:38:27 -03:00
Thiago Santos
9095ee429a v4l2camerasrc: Adds mode property
Adds mode property to v4l2camerasrc
2010-12-08 15:38:27 -03:00
Thiago Santos
dee167edc8 camerabin2: Adding debug categories
Adding debug categories to v4l2camerasrc and camerabin2, also
removing generic category from camerabingeneral.
2010-12-08 15:38:27 -03:00
Thiago Santos
6c72fed8b4 camerabin2: Adding basic property and signals
Adds mode property to camerabin2, allowing users to
select between video and stills capture. Also adds
start/stop capture actions to trigger and stop
capturing
2010-12-08 15:38:27 -03:00
Thiago Santos
a938fd9192 camerabin2: Set filesink's async to FALSE
In order to preroll, camerabin2 should have its filesinks in
the imagecapturebin and videorecordingbin with async=FALSE.
2010-12-08 15:38:27 -03:00
Thiago Santos
1887669d6e camerabin2: Adding basic elements
Instantiating and linking basic elements on camerabin2
so it at least shows the viewfinder when running.
2010-12-08 15:38:27 -03:00
Thiago Santos
3db90e1d43 camerabin2: Adds a stub element for camerabin2
Adds camerabin2 element, it is now a pile of stubs.
2010-12-08 15:38:27 -03:00
Thiago Santos
39093d2199 camerabin2: v4l2camerasrc: Remove platform specific code
Remove platform specific code
2010-12-08 15:38:27 -03:00
Thiago Santos
7f41c2594d camerabin2: Removing uneeded properties
Removing uneeded and unregistered properties.
2010-12-08 15:38:26 -03:00
Thiago Santos
3afa2c3a25 camerabin2: v4l2camerasrc: Fix property warning
Avoid setting a property that doesn't exist.
2010-12-08 15:38:26 -03:00
Thiago Santos
fcf80d0253 camerabin2: v4l2camerasrc: Remove unused variable
Removed unused leftover variable
2010-12-08 15:38:26 -03:00
Thiago Santos
0dce17a4e8 camerabin2: Adds video recording bin
Adds an bin that is responsible for encoding and saving video
streams to files.

For now it is simply a ffmpegcolorspace ! theoraenc ! oggmux !
 filesink bin.

Still uncapable of recording audio.
2010-12-08 15:38:26 -03:00
Thiago Santos
94da473ba7 camerabin2: Adding v4l2camerasrc from robclark's branch
Adds 3-pad v4l2 camera source from Rob Clark's camerabin
branch on http://gitorious.org/robclark-gstreamer/gst-plugins-bad
2010-12-08 15:38:26 -03:00
Thiago Santos
12245366d8 camerabin2: Adds new imagecapturebin
Adds an bin that is responsible for image captures.

It is a simple ffmpegcolorspace ! jpegenc ! jifmux ! multifilesink
for now.
2010-12-08 15:38:26 -03:00
Thiago Santos
3a8ec18f96 camerabin2: Move plugin init to a separate file
Moves plugin init to gstplugin.c to allow multiple
elements to register themselves.
2010-12-08 15:38:26 -03:00
Thiago Santos
67415fc412 camerabin2: viewfinderbin: Adds viewfinderbin element
Adds viewfinder bin element, one of the modules of camerabin2
that is responsible for displaying the video from the camera.

For now it is only a bin with ffmpegcolorspace ! videoscale !
 autovideosink
2010-12-08 15:38:26 -03:00
Alessandro Decina
5c097c447b dvbsuboverlay: fix compiler warnings on OSX. 2010-12-08 19:36:48 +01:00
Mark Nauwelaerts
26877f66c9 mpeg4videoparse: re-use cleanup() in finalize()
... and also favor finalize() rather than dispose().
2010-12-08 16:30:12 +01:00
Arun Raghavan
5b442d0712 mpeg4videoparse: Set srcpad caps before forwarding newsegment
This holds all newsegement and most other events till there is enough
data to set srcpad caps, so that the downstream link is properly
negotiated before data starts flowing.

https://bugzilla.gnome.org/show_bug.cgi?id=635204
2010-12-08 16:30:12 +01:00
Arun Raghavan
8f30fca636 mpeg4videoparse: Use sinkpad caps as base for srcpad caps
This way, we don't lose additional fields that come from upstream (like
profile/level for now).

https://bugzilla.gnome.org/show_bug.cgi?id=635202
2010-12-08 16:30:12 +01:00
Mark Nauwelaerts
522f470883 mpeg4videoparse: minor fix to error handling
We weren't handling unparseable codec_data in some cases.

https://bugzilla.gnome.org/show_bug.cgi?id=635202
2010-12-08 16:30:12 +01:00
Sebastian Dröge
04eb581480 dvbsuboverlay: Implement nearest neighbour scaling for the subpictures
This becomes necessary when SDTV subtitles are used for HDTV videos.
2010-12-08 16:30:12 +01:00
Mark Nauwelaerts
de85aef333 h264parse: align code with comment 2010-12-08 16:30:12 +01:00
Mark Nauwelaerts
26d69e63d4 h264parse: re-use reset() in finalize() 2010-12-08 16:30:12 +01:00
Arun Raghavan
6f966febce h264parse: Set srcpad caps before forwarding newsegment
This holds all newsegement and most other events till there is enough
data to set srcpad caps, so that the downstream link is properly
negotiated before data starts flowing.

https://bugzilla.gnome.org/show_bug.cgi?id=635205
2010-12-08 16:30:12 +01:00
Mark Nauwelaerts
74fb627a08 jpegparse: try to convert comment tag to UTF-8 2010-12-08 16:30:11 +01:00
Mark Nauwelaerts
49d7f207cb jpegparse: discard incomplete image
... as determined when finding SOI next image before an EOI.
2010-12-08 16:30:11 +01:00
Mark Nauwelaerts
0a26e138dd jpegparse: avoid infinite loop when resyncing 2010-12-08 16:30:11 +01:00
Arun Raghavan
7abe0a56af audioparse: Allow implicit channel map for 1-/2-channel audio
This makes sure we don't set an empty channel map array for 1-/2-channel
audio, causing an assert later on.
2010-12-08 16:30:11 +01:00
Sebastian Dröge
8974371914 dvbsuboverlay: Revert some parts of last commit that shouldn't be committed 2010-12-08 16:30:11 +01:00
Sebastian Dröge
68b8fca047 dvbsuboverlay: Really choose the latest possible subpictures
And not the first subpictures that are still valid according to the
page timeout.
2010-12-08 16:30:11 +01:00
Sebastian Dröge
e25a1dc0cc dvbsuboverlay: Refactor blending function and take average of all chroma values 2010-12-08 16:30:11 +01:00
Sebastian Dröge
2282a08890 dvbsuboverlay: Improve selection of current to be displayed subpictures
Drop all subpictures that are too old anyway and clear the currently
displayed subpictures if num_rects==0 happens.
2010-12-08 16:30:11 +01:00
Sebastian Dröge
01cf79ae59 dvbsuboverlay: Implement clipping of video buffers
Also don't clip subpicture buffers, they have no duration and
clipping them doesn't make much sense here.
2010-12-08 16:30:11 +01:00
Sebastian Dröge
672cb276be dvbsuboverlay: Clean up locking some more 2010-12-08 16:30:10 +01:00
Sebastian Dröge
92109fdfbc dvbsuboverlay: Flush subtitles and all internal state when needed 2010-12-08 16:30:10 +01:00
Sebastian Dröge
472cace08b dvbsuboverlay: Set the global library log function exactly once
And don't use one of the possibly many renderer instances, this is only
calling for crashes.
2010-12-08 16:30:10 +01:00
Sebastian Dröge
2a976ae133 dvbsuboverlay: Remove lots of commented out and unused code and clean up locking 2010-12-08 16:30:10 +01:00
Mart Raudsepp
a203ad1aab dvbsuboverlay: Fix more of the blending, so it looks quite good now
* libdvbsub gives us alpha channel already, not transparency level, so
don't do another "alpha = 255 - alpha", this is done by libdvbsub.
* Fix alpha channel handling in interpolation - assrender had an additional
1bpp alpha bitmap as a possible mask, we don't. So don't use the palette
index array as alpha values; bug from quick code porting long ago to
changing pixel colors (assrender has a single pixel color for whole
regions or something, unlike dvbsub, which has indexed colors).
* Don't forget to reassign our YUV and other local pixel color variables
after shifting to work on the bottom part of a 2x2 subsample block, or
it's obviously very blocky.

Remaining issues in blending:

* Should probably be interpolating or doing something else useful with the
resulting U and V channels, so that most of the source pixel UV values would
actually be actually cared about, except for just one out of possibly four.

* Don't convert AYUV to ARGB in libdvbsub, and then back from ARGB to AYUV in
dvbsuboverlay for no reason

* Re-factor the whole thing to something more like textoverlay blending
* Related to that, perhaps cache the current spu in a good format for quick
blending on each frame, after which the more often called blending parts
might become more straightforward
2010-12-08 16:30:10 +01:00
Mart Raudsepp
efa1e9a1fe dvbsuboverlay: Fix blending bug regarding color channel addressing.
libdvbsub gives us ARGB ordered pixels right now, not RGBA.
2010-12-08 16:30:10 +01:00
Mart Raudsepp
21abf9c4a8 dvbsuboverlay: Do blending calls when appropriate
This gives us actually shown subtitles, however with bugs in the
current blitting code, resulting in very transparent subtitles.
2010-12-08 16:30:10 +01:00
Mart Raudsepp
84b52f6eb4 dvbsuboverlay: Implement fallback page_time_out honoring
The spec has a page_time_out in the page composition segment to ensure
subtitles don't get stuck on screen for too much longer than intended,
when future page composition segments get lost on bad reception, or other
problems. Honor it in the gst plugin side.
2010-12-08 16:30:10 +01:00
Mart Raudsepp
3d09a3b18a dvbsuboverlay: Implement subtitle queueing and syncing with video
Push incoming subtitle pages in a FIFO queue (pending_subtitles)
and dequeue the head when it's time to show it (when video running
time reaches the subtitle page running time).
Keep the subtitle page, that is supposed to be blended on top of video
currently, in a separate object variable (current_subtitle). As a
next step we can then pre-render current_subtitle to a better to blend
format.
2010-12-08 16:30:10 +01:00
Mart Raudsepp
41c82583f5 dvbsuboverlay: Make the new dvb_subtitles_free() accept NULL
Don't crash if dvb_subtitles_free(NULL) gets passed, like most other
*_free functions are happy with.
2010-12-08 16:30:10 +01:00
Mart Raudsepp
7e2e52cab8 dvbsuboverlay: Pass page_time_out and pts with the DVBSubtitles structure
Eases holding onto the information in gst plugins side queue of
DVBSubtitles, so we won't need to create yet another temporary struct
to keep the pts and page_time_out too.
And this really logically belongs at the toplevel information set anyway
and in that struct...
2010-12-08 16:30:09 +01:00
Mart Raudsepp
aca7237878 dvbsuboverlay: Make the libdvbsub callback handler responsible for memory cleanup
We want to allow queueing of raw region image data in the gst plugin side,
and keep the data around until we pop the item from the queue. So make
the callback handler responsible for memory cleanup, if one is installed.
2010-12-08 16:30:09 +01:00
Mart Raudsepp
4a68decb52 dvbsuboverlay: Work with GstClockTime instead of PTS for subtitle timing
Abuse libdvbsub PTS tracking to just store our running time in it, to get
it back in the callbacks. As GStreamer does its own PTS handling behind our
back (especially for video), we should just sync with video per running time,
not try to do it with PTS, which doesn't seem well accessible for video chain.
We can later relabel dvb-sub.c pts naming convention if wanted, it's just
passing along guint64 values, which GstClockTime fortunately is too.

The current idea is to collect the regions returned by the callback into
a FIFO buffer and pop and pre-render the top one into a separate
quick-to-blend cached format, which is then appropriately blended in the
video chain until the next one on top of the stack reaches the video chains
running time (or the fallback timer hits).
2010-12-08 16:30:09 +01:00
Mart Raudsepp
316cd44c8d dvbsuboverlay: Add FIXME note about non-constant PTS for a display set handling. 2010-12-08 16:30:09 +01:00
Mart Raudsepp
7cab41013e dvbsuboverlay: Remove dvb_sub_feed() API
GStreamer will only use dvb_sub_feed_with_pts, as it has its own PES filter
to do the header parsing.
2010-12-08 16:30:09 +01:00
Tim-Philipp Müller
08c355823b dvbsuboverlay: more TODO 2010-12-08 16:30:09 +01:00
Mart Raudsepp
1db547f0b6 gstmpegtsdemux: add temporary **HACK** for dvb subs testing so dvbsuboverlay gets whole packets
<tpm> leio, what's the mpegts demux hack about?
<leio> my libdvbsub code can't handle cut packets
<leio> so the hack instructs the demuxer to gather full packets before pushing down, but it applies that to more PES packet types than just dvbsub, but I'm not sure if that's a bad thing
<leio> either way, needs a cleaner solution, either in demuxer, or I need to handle cut packets
<tpm> ok, but really it should be fixed in the overlay, right?
<tpm> or a parser be inserted
<leio> the problem is that I don't know from the first packet beforehand if it is a cut one or no
<leio> not
<leio> err, first buffer
<leio> just when I receive the next one I see if it has a valid timestamp on it or not
<leio> so I can't very well queue it up in the chain either, I might be blocking the very last subtitle for no reason or something
<tpm> but you could just drop/ignore packets until you find one, right?
<leio> find what?
<tpm> a complete packet?
<leio> the problem isn't that they aren't complete
<leio> the problem is that they are cut across multiple GstBuffers by the demuxer without the hack
<tpm> sure, I understand that
<tpm> but you can't easily determine if a GstBuffer contains he start fragment of a packet or not?
<leio> I guess I could parse the packet and see if its length is enough, just like the libdvbsub code eventually does too
<leio> I can, it has a timestamp if it's the first chunk
<leio> I just never know if I need to wait for more, without some parsing
<tpm> ah ok
<leio> while the demuxer could just give me an uncut one in the first place
<leio> like it always does for program streams
<leio> that gather_pes is always set in gstmpegdemux, but not in gstmpegtsdemux
2010-12-08 16:30:09 +01:00
Mart Raudsepp
a8d891dc5e dvbsuboverlay: initial version, work in progress 2010-12-08 16:30:09 +01:00
Mark Nauwelaerts
f64f03264f audioparsers: update some documentation 2010-12-03 18:23:20 +01:00