#endif
#include <gst/basecamerabinsrc/gstbasecamerasrc.h>
-#include <gst/pbutils/encoding-profile.h>
#include "gstcamerabin2.h"
GST_DEBUG_CATEGORY_STATIC (gst_camera_bin_debug);
PROP_IMAGE_CAPTURE_CAPS,
PROP_VIDEO_CAPTURE_CAPS,
PROP_POST_PREVIEWS,
- PROP_PREVIEW_CAPS
+ PROP_PREVIEW_CAPS,
+ PROP_VIDEO_ENCODING_PROFILE
};
enum
"The caps of the preview image to be posted",
GST_TYPE_CAPS, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class, PROP_VIDEO_ENCODING_PROFILE,
+ gst_param_spec_mini_object ("video-profile", "Video Profile",
+ "The GstEncodingProfile to use for video recording",
+ GST_TYPE_ENCODING_PROFILE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
/**
* GstCameraBin::capture-start:
* @camera: the camera bin element
camera->imagebin = gst_element_factory_make ("imagecapturebin", "imagebin");
g_object_set (camera->videosink, "async", FALSE, NULL);
- {
+ if (camera->video_profile == NULL) {
GstEncodingContainerProfile *prof;
GstCaps *caps;
GST_WARNING_OBJECT (camera, "Failed to create encoding profiles");
}
gst_caps_unref (caps);
- g_object_set (camera->encodebin, "profile", prof, NULL);
- gst_encoding_profile_unref (prof);
+
+ camera->video_profile = (GstEncodingProfile *) prof;
}
+ g_object_set (camera->encodebin, "profile", camera->video_profile, NULL);
camera->videobin_queue =
gst_element_factory_make ("queue", "videobin-queue");
"preview-caps"))
g_object_set (camera->src, "preview-caps", camera->preview_caps, NULL);
break;
+ case PROP_VIDEO_ENCODING_PROFILE:
+ camera->video_profile =
+ (GstEncodingProfile *) gst_value_dup_mini_object (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
if (camera->preview_caps)
gst_value_set_caps (value, camera->preview_caps);
break;
+ case PROP_VIDEO_ENCODING_PROFILE:
+ if (camera->video_profile) {
+ gst_value_set_mini_object (value,
+ (GstMiniObject *) camera->video_profile);
+ }
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;