#include "gst-camera2.h"
+ #include <string.h>
+
+ #include <gst/pbutils/encoding-profile.h>
#include <gst/gst.h>
-#include <gst/interfaces/xoverlay.h>
+#include <gst/video/videooverlay.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
static GstElement *camera;
static GtkBuilder *builder;
- gst_caps_new_simple ("application/ogg", NULL), NULL);
+ static GtkWidget *ui_main_window;
+
+ typedef struct
+ {
+ const gchar *name;
+ GstEncodingProfile *(*create_profile) ();
+ } GstCameraVideoFormat;
+
+ static GstEncodingProfile *
+ create_ogg_profile (void)
+ {
+ GstEncodingContainerProfile *container;
+
+ container = gst_encoding_container_profile_new ("ogg", NULL,
- gst_encoding_video_profile_new (gst_caps_new_simple ("video/x-theora",
- NULL), NULL, NULL, 1));
++ gst_caps_new_empty_simple ("application/ogg"), NULL);
+
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
- gst_encoding_audio_profile_new (gst_caps_new_simple ("audio/x-vorbis",
- NULL), NULL, NULL, 1));
++ gst_encoding_video_profile_new (gst_caps_new_empty_simple
++ ("video/x-theora"), NULL, NULL, 1));
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
- gst_caps_new_simple ("video/webm", NULL), NULL);
++ gst_encoding_audio_profile_new (gst_caps_new_empty_simple
++ ("audio/x-vorbis"), NULL, NULL, 1));
+
+ return (GstEncodingProfile *) container;
+ }
+
+ static GstEncodingProfile *
+ create_webm_profile (void)
+ {
+ GstEncodingContainerProfile *container;
+
+ container = gst_encoding_container_profile_new ("webm", NULL,
- gst_encoding_video_profile_new (gst_caps_new_simple ("video/x-vp8", NULL),
++ gst_caps_new_empty_simple ("video/webm"), NULL);
+
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
- gst_encoding_audio_profile_new (gst_caps_new_simple ("audio/x-vorbis",
- NULL), NULL, NULL, 1));
++ gst_encoding_video_profile_new (gst_caps_new_empty_simple ("video/x-vp8"),
+ NULL, NULL, 1));
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
- gst_encoding_video_profile_new (gst_caps_new_simple ("video/x-h264",
- NULL), NULL, NULL, 1));
++ gst_encoding_audio_profile_new (gst_caps_new_empty_simple
++ ("audio/x-vorbis"), NULL, NULL, 1));
+
+ return (GstEncodingProfile *) container;
+ }
+
+ static GstEncodingProfile *
+ create_mp4_profile (void)
+ {
+ GstEncodingContainerProfile *container;
+
+ container = gst_encoding_container_profile_new ("mp4", NULL,
+ gst_caps_new_simple ("video/quicktime", "variant", G_TYPE_STRING, "iso",
+ NULL), NULL);
+
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
++ gst_encoding_video_profile_new (gst_caps_new_empty_simple
++ ("video/x-h264"), NULL, NULL, 1));
+ gst_encoding_container_profile_add_profile (container, (GstEncodingProfile *)
+ gst_encoding_audio_profile_new (gst_caps_new_simple ("audio/mpeg",
+ "version", G_TYPE_INT, 4, NULL), NULL, NULL, 1));
+
+ return (GstEncodingProfile *) container;
+ }
+
+ GstCameraVideoFormat formats[] = {
+ {"ogg (theora/vorbis)", create_ogg_profile}
+ ,
+ {"webm (vp8/vorbis)", create_webm_profile}
+ ,
+ {"mp4 (h264+aac)", create_mp4_profile}
+ ,
+ {NULL, NULL}
+ };
void
on_mainWindow_delete_event (GtkWidget * widget, GdkEvent * event, gpointer data)