From 6ba122834a4972e0bd1e9950eeed8ea127ea3fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 23 Jun 2009 18:23:13 +0200 Subject: shapewipe: Correctly handle 0/1 fps --- gst/shapewipe/gstshapewipe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c index 95218801..4029c494 100644 --- a/gst/shapewipe/gstshapewipe.c +++ b/gst/shapewipe/gstshapewipe.c @@ -334,7 +334,10 @@ gst_shape_wipe_video_sink_setcaps (GstPad * pad, GstCaps * caps) g_mutex_unlock (self->mask_mutex); } - self->frame_duration = gst_util_uint64_scale (GST_SECOND, fps_d, fps_n); + if (fps_n != 0) + self->frame_duration = gst_util_uint64_scale (GST_SECOND, fps_d, fps_n); + else + self->frame_duration = 0; ret = gst_pad_set_caps (self->srcpad, caps); -- cgit v1.2.1 From da11b1672fcd03717ca445b8ff300dc2527c0b87 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 23 Jun 2009 18:01:18 +0200 Subject: xvidenc: also allow video/mpeg on output caps. Fixes #377784. --- ext/xvid/gstxvidenc.c | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/ext/xvid/gstxvidenc.c b/ext/xvid/gstxvidenc.c index 40b5be22..c5598595 100644 --- a/ext/xvid/gstxvidenc.c +++ b/ext/xvid/gstxvidenc.c @@ -59,6 +59,11 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/x-xvid, " + "width = (int) [ 0, MAX ], " + "height = (int) [ 0, MAX ], " "framerate = (fraction) [ 0/1, MAX ]; " + "video/mpeg, " + "mpegversion = (int) 4, " + "systemstream = (boolean) FALSE, " "width = (int) [ 0, MAX ], " "height = (int) [ 0, MAX ], " "framerate = (fraction) [ 0/1, MAX ]") ); @@ -731,31 +736,37 @@ gst_xvidenc_setcaps (GstPad * pad, GstCaps * vscaps) xvidenc->xframe_cache = NULL; if (gst_xvidenc_setup (xvidenc)) { - GstPadLinkReturn ret; - GstCaps *new_caps; - GstPad *peer; + gboolean ret = FALSE; + GstCaps *new_caps = NULL, *allowed_caps; + + /* please downstream with preferred caps */ + allowed_caps = gst_pad_get_allowed_caps (xvidenc->srcpad); + GST_DEBUG_OBJECT (xvidenc, "allowed caps: %" GST_PTR_FORMAT, allowed_caps); + + if (allowed_caps && !gst_caps_is_empty (allowed_caps)) { + new_caps = gst_caps_copy_nth (allowed_caps, 0); + } else { + new_caps = gst_caps_new_simple ("video/x-xvid", NULL); + } + if (allowed_caps) + gst_caps_unref (allowed_caps); - new_caps = gst_caps_new_simple ("video/x-xvid", + gst_caps_set_simple (new_caps, "width", G_TYPE_INT, w, "height", G_TYPE_INT, h, "framerate", GST_TYPE_FRACTION, xvidenc->fbase, xvidenc->fincr, "pixel-aspect-ratio", GST_TYPE_FRACTION, xvidenc->par_width, xvidenc->par_height, NULL); + /* just to be sure */ + gst_pad_fixate_caps (xvidenc->srcpad, new_caps); + /* src pad should accept anyway */ ret = gst_pad_set_caps (xvidenc->srcpad, new_caps); - if (!ret) - goto exit; - /* will peer accept */ - peer = gst_pad_get_peer (xvidenc->srcpad); - if (peer) - ret &= gst_pad_accept_caps (peer, new_caps); - gst_object_unref (peer); - - exit: + gst_caps_unref (new_caps); + if (!ret && xvidenc->handle) { xvid_encore (xvidenc->handle, XVID_ENC_DESTROY, NULL, NULL); xvidenc->handle = NULL; } - gst_caps_unref (new_caps); return ret; } else /* setup did not work out */ -- cgit v1.2.1 From eb528cbcc4dab321910defb319feb4387b30b548 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 22 Jun 2009 03:55:27 +0100 Subject: VDPAU: Move I420/YV12 to the front of the caps. Add debug. Make I420/YV12 caps be preferred when downloading to YUV buffers, when possible, by listing them first in the set of output caps. Add some debug in the caps selection code. --- sys/vdpau/gstvdpdevice.h | 20 ++++++++++---------- sys/vdpau/gstvdpvideoyuv.c | 3 +++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/sys/vdpau/gstvdpdevice.h b/sys/vdpau/gstvdpdevice.h index ac036d73..38cd84bb 100644 --- a/sys/vdpau/gstvdpdevice.h +++ b/sys/vdpau/gstvdpdevice.h @@ -84,6 +84,16 @@ static const VdpChromaType chroma_types[N_CHROMA_TYPES] = { VDP_CHROMA_TYPE_420, VDP_CHROMA_TYPE_422, VDP_CHROMA_TYPE_444 }; static const VdpauFormats formats[N_FORMATS] = { + { + VDP_CHROMA_TYPE_420, + VDP_YCBCR_FORMAT_YV12, + GST_MAKE_FOURCC ('I', '4', '2', '0') + }, + { + VDP_CHROMA_TYPE_420, + VDP_YCBCR_FORMAT_YV12, + GST_MAKE_FOURCC ('Y', 'V', '1', '2') + }, { VDP_CHROMA_TYPE_420, VDP_YCBCR_FORMAT_NV12, @@ -108,16 +118,6 @@ static const VdpauFormats formats[N_FORMATS] = { VDP_CHROMA_TYPE_422, VDP_YCBCR_FORMAT_YUYV, GST_MAKE_FOURCC ('Y', 'U', 'Y', 'V') - }, - { - VDP_CHROMA_TYPE_420, - VDP_YCBCR_FORMAT_YV12, - GST_MAKE_FOURCC ('Y', 'V', '1', '2') - }, - { - VDP_CHROMA_TYPE_420, - VDP_YCBCR_FORMAT_YV12, - GST_MAKE_FOURCC ('I', '4', '2', '0') } }; diff --git a/sys/vdpau/gstvdpvideoyuv.c b/sys/vdpau/gstvdpvideoyuv.c index 2318cd40..bd780075 100644 --- a/sys/vdpau/gstvdpvideoyuv.c +++ b/sys/vdpau/gstvdpvideoyuv.c @@ -332,6 +332,9 @@ gst_vdp_video_yuv_sink_set_caps (GstPad * pad, GstCaps * caps) if (G_UNLIKELY (!src_caps || !gst_caps_get_size (src_caps))) return FALSE; + GST_DEBUG_OBJECT (video_yuv, + "Selecting first caps from set: %" GST_PTR_FORMAT, src_caps); + new_caps = gst_caps_copy_nth (src_caps, 0); gst_caps_unref (src_caps); if (G_UNLIKELY (!new_caps)) -- cgit v1.2.1 From 61b0a10d52cceff956e6d7d81d9e2a5dc14d4169 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 24 Jun 2009 15:14:33 +0100 Subject: Automatic update of common submodule From f3bb51b to f810030 --- common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common b/common index f3bb51b8..f810030e 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit f3bb51b867ff403f70d36fc772861d8e57c703ed +Subproject commit f810030e4692aa43ae84f6649730fe25558a9738 -- cgit v1.2.1 From a265e4d2b380ecae7a53996c55a42689912e5488 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Tue, 21 Apr 2009 10:55:36 +0300 Subject: camerabin: leave v4l2camsrc "capture-mode" as video mode when pausing --- gst/camerabin/gstcamerabin.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index ca2e8e18..8e53db4c 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -3201,12 +3201,6 @@ gst_camerabin_user_pause (GstCameraBin * camera) g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", FALSE, "active-pad", camera->pad_src_view, NULL); - /* Enable view finder mode in v4l2camsrc */ - if (g_object_class_find_property (G_OBJECT_GET_CLASS - (camera->src_vid_src), "capture-mode")) { - g_object_set (G_OBJECT (camera->src_vid_src), "capture-mode", 0, NULL); - } - /* Set view finder to PLAYING and leave videobin PAUSED */ gst_element_set_locked_state (camera->vidbin, TRUE); gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING); @@ -3222,12 +3216,6 @@ gst_camerabin_user_pause (GstCameraBin * camera) g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", TRUE, "active-pad", camera->pad_src_vid, NULL); - /* Enable video recording mode in v4l2camsrc */ - if (g_object_class_find_property (G_OBJECT_GET_CLASS - (camera->src_vid_src), "capture-mode")) { - g_object_set (G_OBJECT (camera->src_vid_src), "capture-mode", 2, NULL); - } - /* Bring all camerabin elements to PLAYING */ gst_element_set_locked_state (camera->vidbin, FALSE); gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING); -- cgit v1.2.1 From 8a39d280029bf98ebf499876604692dcf41e0ee0 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Tue, 16 Jun 2009 18:12:29 +0300 Subject: camerabin: set image bin to PAUSED when starting capture Set image bin to PAUSED also when starting capture using photography interface. --- gst/camerabin/gstcamerabin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 8e53db4c..3809a037 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -1528,9 +1528,9 @@ img_capture_prepared (gpointer data, GstCaps * caps) g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", FALSE, "active-pad", camera->pad_src_img, NULL); - if (!GST_CAMERABIN_IMAGE (camera->imgbin)->elements_created) { - gst_element_set_state (camera->imgbin, GST_STATE_READY); - } + /* We need to set image bin to PAUSED or buffer-allocs will fail */ + GST_DEBUG_OBJECT (camera, "setting image bin to PAUSED"); + gst_element_set_state (camera->imgbin, GST_STATE_PAUSED); } /* -- cgit v1.2.1 From 18e7091238e1a692f7a1d5b4cadc5089f04e1e2c Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Tue, 23 Jun 2009 13:01:13 +0300 Subject: camerabin: fix setting mute when video bin elements haven't been created --- gst/camerabin/camerabinvideo.c | 20 ++++++++++++++------ gst/camerabin/camerabinvideo.h | 8 ++------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gst/camerabin/camerabinvideo.c b/gst/camerabin/camerabinvideo.c index d3de662e..2569772a 100644 --- a/gst/camerabin/camerabinvideo.c +++ b/gst/camerabin/camerabinvideo.c @@ -184,6 +184,8 @@ gst_camerabin_video_init (GstCameraBinVideo * vid, vid->pending_eos = NULL; + vid->mute = ARG_DEFAULT_MUTE; + /* Create src and sink ghost pads */ vid->sinkpad = gst_ghost_pad_new_no_target ("sink", GST_PAD_SINK); gst_element_add_pad (GST_ELEMENT (vid), vid->sinkpad); @@ -629,6 +631,8 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid) GST_WARNING_OBJECT (vid, "unable to add volume element"); /* gst_camerabin_try_add_element() destroyed the element */ vid->volume = NULL; + } else { + g_object_set (vid->volume, "mute", vid->mute, NULL); } /* Add user set or default audio encoder element */ @@ -732,8 +736,11 @@ gst_camerabin_video_destroy_elements (GstCameraBinVideo * vid) void gst_camerabin_video_set_mute (GstCameraBinVideo * vid, gboolean mute) { - if (vid && vid->volume) { - GST_DEBUG_OBJECT (vid, "setting mute %s", mute ? "on" : "off"); + g_return_if_fail (vid != NULL); + + GST_DEBUG_OBJECT (vid, "setting mute %s", mute ? "on" : "off"); + vid->mute = mute; + if (vid->volume) { g_object_set (vid->volume, "mute", mute, NULL); } } @@ -800,12 +807,13 @@ gst_camerabin_video_set_audio_src (GstCameraBinVideo * vid, gboolean gst_camerabin_video_get_mute (GstCameraBinVideo * vid) { - gboolean mute = ARG_DEFAULT_MUTE; + g_return_val_if_fail (vid != NULL, FALSE); - if (vid && vid->volume) { - g_object_get (vid->volume, "mute", &mute, NULL); + if (vid->volume) { + g_object_get (vid->volume, "mute", &vid->mute, NULL); } - return mute; + + return vid->mute; } GstElement * diff --git a/gst/camerabin/camerabinvideo.h b/gst/camerabin/camerabinvideo.h index 9f4f5152..dd094d52 100644 --- a/gst/camerabin/camerabinvideo.h +++ b/gst/camerabin/camerabinvideo.h @@ -24,24 +24,19 @@ #include G_BEGIN_DECLS - //#define USE_TIMEOVERLAY 1 - #define ARG_DEFAULT_MUTE FALSE - #define GST_TYPE_CAMERABIN_VIDEO (gst_camerabin_video_get_type()) #define GST_CAMERABIN_VIDEO_CAST(obj) ((GstCameraBinVideo*)(obj)) #define GST_CAMERABIN_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CAMERABIN_VIDEO,GstCameraBinVideo)) #define GST_CAMERABIN_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CAMERABIN_VIDEO,GstCameraBinVideoClass)) #define GST_IS_CAMERABIN_VIDEO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CAMERABIN_VIDEO)) #define GST_IS_CAMERABIN_VIDEO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CAMERABIN_VIDEO)) - /** * GstCameraBinVideo: * * The opaque #GstCameraBinVideo structure. */ - typedef struct _GstCameraBinVideo GstCameraBinVideo; typedef struct _GstCameraBinVideoClass GstCameraBinVideoClass; @@ -86,6 +81,8 @@ struct _GstCameraBinVideo GstElement *muxer; /* Muxer */ GstEvent *pending_eos; + + gboolean mute; }; struct _GstCameraBinVideoClass @@ -132,5 +129,4 @@ GstElement *gst_camerabin_video_get_muxer (GstCameraBinVideo * vid); GstElement *gst_camerabin_video_get_audio_src (GstCameraBinVideo * vid); G_END_DECLS - #endif /* #ifndef __CAMERABIN_VIDEO_H__ */ -- cgit v1.2.1 From c3abf1b2674d7ec70d8bf03429265c5e15d89962 Mon Sep 17 00:00:00 2001 From: Lasse Laukkanen Date: Tue, 23 Jun 2009 13:01:52 +0300 Subject: camerabin: buffer-alloc support fixes to image and video bin handling Keep image bin in PAUSED state in image mode except when processing/saving (PLAYING/READY). Change output-selector to view finder before setting video bin to READY. Fix filename sent with img-done signal. --- gst/camerabin/gstcamerabin.c | 74 +++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 45 deletions(-) diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 3809a037..0a110f50 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -907,29 +907,22 @@ camerabin_dispose_elements (GstCameraBin * camera) /* * gst_camerabin_image_capture_continue: * @camera: camerabin object + * @filename: filename of the finished image * * Notify application that image has been saved with a signal. * * Returns TRUE if another image should be captured, FALSE otherwise. */ static gboolean -gst_camerabin_image_capture_continue (GstCameraBin * camera) +gst_camerabin_image_capture_continue (GstCameraBin * camera, + const gchar * filename) { - gchar *filename = NULL; gboolean cont = FALSE; - /* Check the filename of the written image */ - g_object_get (G_OBJECT (camera->imgbin), "filename", &filename, NULL); - GST_DEBUG_OBJECT (camera, "emitting img_done signal, filename: %s", filename); g_signal_emit (G_OBJECT (camera), camerabin_signals[IMG_DONE_SIGNAL], 0, filename, &cont); - g_free (filename); - - GST_DEBUG_OBJECT (camera, "emitted img_done, new filename: %s, continue: %d", - camera->filename->str, cont); - /* If the app wants to continue make sure new filename has been set */ if (cont && g_str_equal (camera->filename->str, "")) { GST_ELEMENT_ERROR (camera, RESOURCE, NOT_FOUND, @@ -965,11 +958,7 @@ gst_camerabin_change_mode (GstCameraBin * camera, gint mode) GstStateChangeReturn state_ret; camera->active_bin = camera->imgbin; - /* we can't go to playing as filesink would error out if it does not have - * a filename yet, we set the filename async with the buffer flow */ - state_ret = gst_element_set_state (camera->active_bin, GST_STATE_READY); - GST_DEBUG_OBJECT (camera, "setting imagebin to ready: %s", - gst_element_state_change_return_get_name (state_ret)); + state_ret = gst_element_set_state (camera->active_bin, GST_STATE_PAUSED); if (state_ret == GST_STATE_CHANGE_FAILURE) { GST_WARNING_OBJECT (camera, "state change failed"); @@ -1527,10 +1516,6 @@ img_capture_prepared (gpointer data, GstCaps * caps) } g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", FALSE, "active-pad", camera->pad_src_img, NULL); - - /* We need to set image bin to PAUSED or buffer-allocs will fail */ - GST_DEBUG_OBJECT (camera, "setting image bin to PAUSED"); - gst_element_set_state (camera->imgbin, GST_STATE_PAUSED); } /* @@ -1542,7 +1527,6 @@ img_capture_prepared (gpointer data, GstCaps * caps) static void gst_camerabin_start_image_capture (GstCameraBin * camera) { - GstStateChangeReturn state_ret; gboolean wait_for_prepare = FALSE, ret = FALSE; GST_INFO_OBJECT (camera, "starting image capture"); @@ -1576,23 +1560,12 @@ gst_camerabin_start_image_capture (GstCameraBin * camera) } if (!wait_for_prepare) { - /* Image queue's srcpad data probe will set imagebin to PLAYING */ - state_ret = gst_element_set_state (camera->imgbin, GST_STATE_PAUSED); - GST_DEBUG_OBJECT (camera, "setting imagebin to paused: %s", - gst_element_state_change_return_get_name (state_ret)); - - if (state_ret != GST_STATE_CHANGE_FAILURE) { - GST_INFO_OBJECT (camera, "imagebin is PAUSED"); - g_mutex_lock (camera->capture_mutex); - g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", TRUE, - "active-pad", camera->pad_src_img, NULL); - camera->capturing = TRUE; - ret = TRUE; - g_mutex_unlock (camera->capture_mutex); - } else { - GST_WARNING_OBJECT (camera, "imagebin state change failed"); - gst_element_set_state (camera->imgbin, GST_STATE_NULL); - } + g_mutex_lock (camera->capture_mutex); + g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", TRUE, + "active-pad", camera->pad_src_img, NULL); + camera->capturing = TRUE; + ret = TRUE; + g_mutex_unlock (camera->capture_mutex); } if (!ret) { @@ -1672,7 +1645,6 @@ gst_camerabin_send_video_eos (GstCameraBin * camera) * @blocked: TRUE to block, FALSE to unblock * @u_data: camera bin object * - * Sends eos event to image bin if blocking pad leading to image bin. * The pad will be unblocked when image bin posts eos message. */ static void @@ -1945,6 +1917,12 @@ gst_camerabin_reset_to_view_finder (GstCameraBin * camera) GstStateChangeReturn state_ret; GST_DEBUG_OBJECT (camera, "resetting"); + if (camera->src_out_sel) { + /* Set selector to forward data to view finder */ + g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", FALSE, + "active-pad", camera->pad_src_view, NULL); + } + /* Set video bin to READY state */ if (camera->active_bin == camera->vidbin) { state_ret = gst_element_set_state (camera->active_bin, GST_STATE_READY); @@ -1959,12 +1937,6 @@ gst_camerabin_reset_to_view_finder (GstCameraBin * camera) camera->stop_requested = FALSE; camera->paused = FALSE; - if (camera->src_out_sel) { - /* Set selector to forward data to view finder */ - g_object_set (G_OBJECT (camera->src_out_sel), "resend-latest", FALSE, - "active-pad", camera->pad_src_view, NULL); - } - /* Enable view finder mode in v4l2camsrc */ if (camera->src_vid_src && g_object_class_find_property (G_OBJECT_GET_CLASS (camera->src_vid_src), @@ -3064,6 +3036,10 @@ static gboolean gst_camerabin_imgbin_finished (gpointer u_data) { GstCameraBin *camera = GST_CAMERABIN (u_data); + gchar *filename = NULL; + + /* Get the filename of the finished image */ + g_object_get (G_OBJECT (camera->imgbin), "filename", &filename, NULL); GST_DEBUG_OBJECT (camera, "Image encoding finished"); @@ -3072,7 +3048,11 @@ gst_camerabin_imgbin_finished (gpointer u_data) GST_DEBUG_OBJECT (camera, "Image pipeline set to READY"); /* Send img-done signal */ - gst_camerabin_image_capture_continue (camera); + gst_camerabin_image_capture_continue (camera, filename); + g_free (filename); + + /* Set image bin back to PAUSED so that buffer-allocs don't fail */ + gst_element_set_state (camera->imgbin, GST_STATE_PAUSED); /* Unblock image queue pad to process next buffer */ gst_pad_set_blocked_async (camera->pad_src_queue, FALSE, @@ -3143,6 +3123,10 @@ gst_camerabin_user_start (GstCameraBin * camera) if (!camera->active_bin) { GST_INFO_OBJECT (camera, "mode not explicitly set by application"); gst_camerabin_change_mode (camera, camera->mode); + if (!camera->active_bin) { + GST_ELEMENT_ERROR (camera, CORE, FAILED, + ("starting capture failed"), (NULL)); + } } if (g_str_equal (camera->filename->str, "")) { -- cgit v1.2.1 From fa78a0f1251c17089760d2091d6730200342746c Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 24 Jun 2009 18:56:28 +0300 Subject: camerabin: add target-times option to specify test times Have some reasonable default times. Add a commandline option to override defaults. Interpret target-time=0 as skip-test. --- tests/examples/camerabin/gst-camera-perf.c | 46 +++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/tests/examples/camerabin/gst-camera-perf.c b/tests/examples/camerabin/gst-camera-perf.c index ece3d935..b6424181 100644 --- a/tests/examples/camerabin/gst-camera-perf.c +++ b/tests/examples/camerabin/gst-camera-perf.c @@ -39,6 +39,7 @@ * ./gst-camera-perf --src-colorspace=UYVY --image-width=640 --image-height=480 --view-framerate-num=2999 --view-framerate-den=100 --video-src=v4l2camsrc --audio-enc=nokiaaacenc --video-enc=omx_mpeg4enc --video-mux=hantromp4mux * ./gst-camera-perf --src-colorspace=UYVY --image-width=2592 --image-height=1968 --view-framerate-num=399 --view-framerate-den=100 --video-src=v4l2camsrc --audio-enc=nokiaaacenc --video-enc=omx_mpeg4enc --video-mux=hantromp4mux * ./gst-camera-perf --src-colorspace=UYVY --image-width=2592 --image-height=1968 --view-framerate-num=325 --view-framerate-den=25 --video-src=v4l2camsrc --audio-enc=nokiaaacenc --video-enc=omx_mpeg4enc --video-mux=hantromp4mux --image-enc=dspjpegenc + * ./gst-camera-perf --src-colorspace=UYVY --image-width=640 --image-height=480 --view-framerate-num=1491 --view-framerate-den=100 --video-src=v4l2camsrc --audio-enc=nokiaaacenc --video-enc=omx_mpeg4enc --video-mux=hantromp4mux --target-times=1000,0,1500,0,0,0,0,1000,0 */ /* @@ -113,16 +114,17 @@ static GstClockTime t_final[CONT_SHOTS] = { G_GUINT64_CONSTANT (0), }; static GstClockTimeDiff diff; static ResultType result; -static const GstClockTime target[TEST_CASES] = { +/* these can be overridden with commandline args --target-times */ +static GstClockTime target[TEST_CASES] = { 1000 * GST_MSECOND, - 0, /* 1500 * GST_MSECOND, not tested */ + 1500 * GST_MSECOND, 1500 * GST_MSECOND, 2000 * GST_MSECOND, /* this should be shorter, as we can take next picture before preview is ready */ 500 * GST_MSECOND, - 0, /* 2000 * GST_MSECOND, not tested */ + 2000 * GST_MSECOND, 3500 * GST_MSECOND, 1000 * GST_MSECOND, - 0 /* 1000 * GST_MSECOND, not tested */ + 1000 * GST_MSECOND }; static const gchar *test_names[TEST_CASES] = { @@ -604,7 +606,8 @@ static test_case test_cases[TEST_CASES] = { test_05, NULL, test_07, - test_08 + test_08, + NULL }; static void @@ -627,14 +630,19 @@ run_test (gpointer user_data) printf ("| %02d ", test_ix + 1); if (test_cases[test_ix]) { - memset (&result, 0, sizeof (ResultType)); - ret = test_cases[test_ix] (); + if (target[test_ix]) { + memset (&result, 0, sizeof (ResultType)); + ret = test_cases[test_ix] (); - //while (g_main_context_pending (NULL)) g_main_context_iteration (NULL,FALSE); - if (ret) { - print_result (); + //while (g_main_context_pending (NULL)) g_main_context_iteration (NULL,FALSE); + if (ret) { + print_result (); + } + } else { + printf ("| test skipped "); + printf ("| %-19s |\n", test_names[test_ix]); + test_ix++; } - } else { printf ("| test not implemented "); printf ("| %-19s |\n", test_names[test_ix]); @@ -654,6 +662,7 @@ run_test (gpointer user_data) int main (int argc, char *argv[]) { + gchar *target_times = NULL; GOptionEntry options[] = { {"audio-src", '\0', 0, G_OPTION_ARG_STRING, &audiosrc_name, "audio source used in video recording", NULL}, @@ -677,6 +686,9 @@ main (int argc, char *argv[]) "framerate denominator for viewfinder", NULL}, {"src-colorspace", '\0', 0, G_OPTION_ARG_STRING, &src_csp, "colorspace format for videosource (e.g. YUY2, UYVY)", NULL}, + {"target-times", '\0', 0, G_OPTION_ARG_STRING, &target_times, + "target test times in ms as comma separated values (0 to skip test)", + NULL}, {NULL} }; GOptionContext *ctx; @@ -698,6 +710,17 @@ main (int argc, char *argv[]) filename = g_string_new_len ("", 16); loop = g_main_loop_new (NULL, FALSE); + if (target_times) { + gchar **numbers; + gint i; + + numbers = g_strsplit (target_times, ",", TEST_CASES); + for (i = 0; (numbers[i] && i < TEST_CASES); i++) { + target[i] = GST_MSECOND * atoi (numbers[i]); + } + g_strfreev (numbers); + } + /* run */ puts (""); puts ("+---------------------------------------------------------------------------------------+"); @@ -721,6 +744,7 @@ main (int argc, char *argv[]) g_free (imageenc_name); g_free (videomux_name); g_free (src_csp); + g_free (target_times); return 0; } -- cgit v1.2.1 From d6ff39bb35d7089ed04d47261d2e6b6f9ada3bf7 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 25 Jun 2009 08:38:10 +0200 Subject: qtmux: Fix debug statement. --- gst/qtmux/gstqtmux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c index 8d811f41..ba155f6a 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -529,7 +529,8 @@ gst_qt_mux_add_3gp_date (GstQTMux * qtmux, const GstTagList * list, return; } - GST_DEBUG_OBJECT (qtmux, "Adding tag %" GST_FOURCC_FORMAT " -> %d", year); + GST_DEBUG_OBJECT (qtmux, "Adding tag %" GST_FOURCC_FORMAT " -> %d", + GST_FOURCC_ARGS (fourcc), year); atom_moov_add_3gp_uint_tag (qtmux->moov, fourcc, year); } -- cgit v1.2.1 From 1bb23517feced9fb3dddf702e93391c3a969fbf2 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 25 Jun 2009 08:38:21 +0200 Subject: qtmux: Remove unused variable. --- gst/qtmux/atoms.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c index 29859d00..ad3e0108 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -3004,14 +3004,11 @@ build_esds_extension (AtomTRAK * trak, guint8 object_type, guint8 stream_type, AtomInfo * build_mov_aac_extension (AtomTRAK * trak, const GstBuffer * codec_data) { - guint32 track_id; AtomWAVE *wave; AtomFRMA *frma; Atom *ext_atom; GstBuffer *buf; - track_id = trak->tkhd.track_ID; - /* Add WAVE atom to the MP4A sample table entry */ wave = atom_wave_new (); -- cgit v1.2.1