Re: [PATCH] crystalhd gst: Port to GStreamer 1.0 API

2013-07-21 Thread Guido Günther
Hi,
On Mon, Apr 01, 2013 at 01:26:54PM +0200, Guido Günther wrote:
 Hi,
 On Mon, Mar 11, 2013 at 09:40:22AM +0100, Guido Günther wrote:
  ---
  Tested with totem as well as gst-launch. Any chance this can be applied
  to http://git.linuxtv.org/jarod/crystalhd.git?
 
 Any chance this gets applied.

Ping? It would really be nice to have a gstreamer 1.0 version.
Cheers,
 -- Guido

 
  Cheers,
   -- Guido
  
   filters/gst/gst-plugin/configure.ac|8 +-
   filters/gst/gst-plugin/src/gstbcmdec.c |  431 
  
   filters/gst/gst-plugin/src/gstbcmdec.h |   68 ++---
   3 files changed, 248 insertions(+), 259 deletions(-)
  
  diff --git a/filters/gst/gst-plugin/configure.ac 
  b/filters/gst/gst-plugin/configure.ac
  index 99b3713..a3c6467 100644
  --- a/filters/gst/gst-plugin/configure.ac
  +++ b/filters/gst/gst-plugin/configure.ac
  @@ -1,9 +1,9 @@
   AC_INIT
   
   dnl versions of gstreamer and plugins-base
  -GST_MAJORMINOR=0.10
  -GST_REQUIRED=0.10.0
  -GSTPB_REQUIRED=0.10.0
  +GST_MAJORMINOR=1.0
  +GST_REQUIRED=1.0
  +GSTPB_REQUIRED=1.0
   
   dnl fill in your package name and version here
   dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
  @@ -56,7 +56,7 @@ dnl And we can also ask for the right version of gstreamer
   
   PKG_CHECK_MODULES(GST, \
 gstreamer-$GST_MAJORMINOR = $GST_REQUIRED
  -  gstreamer-video-0.10,
  +  gstreamer-video-1.0,
 HAVE_GST=yes,HAVE_GST=no)
   
   dnl Give error and exit if we don't have gstreamer
  diff --git a/filters/gst/gst-plugin/src/gstbcmdec.c 
  b/filters/gst/gst-plugin/src/gstbcmdec.c
  index ed01c14..a51bd59 100644
  --- a/filters/gst/gst-plugin/src/gstbcmdec.c
  +++ b/filters/gst/gst-plugin/src/gstbcmdec.c
  @@ -8,6 +8,7 @@
*  AU
*
*  HISTORY:
  + * Updated for 1.0 by Guido Guenther a...@sigxcpu.org
*
***
*
  @@ -40,6 +41,7 @@
   #include glib.h
   #include gst/base/gstadapter.h
   #include gst/video/video.h
  +#include gst/video/gstvideopool.h
   
   #ifdef HAVE_CONFIG_H
   #include config.h
  @@ -51,8 +53,8 @@
   #include parse.h
   #include gstbcmdec.h
   
  -GST_DEBUG_CATEGORY_STATIC (gst_bcmdec_debug);
  -#define GST_CAT_DEFAULT gst_bcmdec_debug
  +GST_DEBUG_CATEGORY_STATIC (gst_bcm_dec_debug);
  +#define GST_CAT_DEFAULT gst_bcm_dec_debug
   
   //#define YV12__
   
  @@ -64,16 +66,18 @@ static GstFlowReturn 
  bcmdec_send_buff_detect_error(GstBcmDec *bcmdec, GstBuffer
 guint8 flags)
   {
  BC_STATUS sts = BC_STS_SUCCESS;
  +   GstMapInfo info;
   
  GST_DEBUG_OBJECT(bcmdec, Attempting to Send Buffer);
   
  sts = decif_send_buffer(bcmdec-decif, pbuffer, size, tCurrent, flags);
   
  if (sts != BC_STS_SUCCESS) {
  +   gst_buffer_map(buf, info, GST_MAP_READ);
  GST_ERROR_OBJECT(bcmdec, proc input failed sts = %d, sts);
  GST_ERROR_OBJECT(bcmdec, Chain: timeStamp = %llu size = %d 
  data = %p,
  -GST_BUFFER_TIMESTAMP(buf), 
  GST_BUFFER_SIZE(buf),
  -GST_BUFFER_DATA (buf));
  +GST_BUFFER_DTS(buf), info.size, info.data);
  +   gst_buffer_unmap(buf, info);
  return GST_FLOW_ERROR;
  }
   
  @@ -92,7 +96,7 @@ enum {
   };
   
   
  -GLB_INST_STS *g_inst_sts = NULL;
  +static GLB_INST_STS *g_inst_sts = NULL;
   
   /*
* the capabilities of the inputs and outputs.
  @@ -111,35 +115,29 @@ GstStaticPadTemplate sink_factory_bcm70012 = 
  GST_STATIC_PAD_TEMPLATE(sink, GST
   
   #ifdef YV12__
   static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
  GST_PAD_SRC, GST_PAD_ALWAYS,
  -   GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YV12 
  },  width = (int) [ 1, MAX ], 
  +   GST_STATIC_CAPS(video/x-raw,  format = (string) { YV12 },  
  width = (int) [ 1, MAX ], 
  height = (int) [ 1, MAX ],  framerate = 
  (fraction) [ 0/1, 2147483647/1 ]));
   #define BUF_MULT (12 / 8)
   #define BUF_MODE MODE420
   #else
   static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
  GST_PAD_SRC, GST_PAD_ALWAYS,
  -   GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YUY2 } 
  ,  framerate = (fraction) [0,MAX], 
  -   width = (int) [1,MAX],  height = (int) 
  [1,MAX];  video/x-raw-yuv, 
  -   format = (fourcc) { UYVY } ,  framerate = 
  (fraction) [0,MAX],  width = (int) [1,MAX], 
  +   GST_STATIC_CAPS(video/x-raw,  format = (string) { YUY2 } ,  
  framerate = (fraction) [0,MAX], 
  +   width = (int) [1,MAX],  height = (int) 
  [1,MAX];  video/x-raw, 
  +   format = (string) { UYVY } ,  framerate = 
  (fraction) [0,MAX],  width = (int) [1,MAX], 
  height = (int) [1,MAX]; ));
   #define BUF_MULT (16 / 8)
   

Re: [PATCH] crystalhd gst: Port to GStreamer 1.0 API

2013-04-01 Thread Guido Günther
Hi,
On Mon, Mar 11, 2013 at 09:40:22AM +0100, Guido Günther wrote:
 ---
 Tested with totem as well as gst-launch. Any chance this can be applied
 to http://git.linuxtv.org/jarod/crystalhd.git?

Any chance this gets applied.

 Cheers,
  -- Guido
 
  filters/gst/gst-plugin/configure.ac|8 +-
  filters/gst/gst-plugin/src/gstbcmdec.c |  431 
 
  filters/gst/gst-plugin/src/gstbcmdec.h |   68 ++---
  3 files changed, 248 insertions(+), 259 deletions(-)
 
 diff --git a/filters/gst/gst-plugin/configure.ac 
 b/filters/gst/gst-plugin/configure.ac
 index 99b3713..a3c6467 100644
 --- a/filters/gst/gst-plugin/configure.ac
 +++ b/filters/gst/gst-plugin/configure.ac
 @@ -1,9 +1,9 @@
  AC_INIT
  
  dnl versions of gstreamer and plugins-base
 -GST_MAJORMINOR=0.10
 -GST_REQUIRED=0.10.0
 -GSTPB_REQUIRED=0.10.0
 +GST_MAJORMINOR=1.0
 +GST_REQUIRED=1.0
 +GSTPB_REQUIRED=1.0
  
  dnl fill in your package name and version here
  dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
 @@ -56,7 +56,7 @@ dnl And we can also ask for the right version of gstreamer
  
  PKG_CHECK_MODULES(GST, \
gstreamer-$GST_MAJORMINOR = $GST_REQUIRED
 -  gstreamer-video-0.10,
 +  gstreamer-video-1.0,
HAVE_GST=yes,HAVE_GST=no)
  
  dnl Give error and exit if we don't have gstreamer
 diff --git a/filters/gst/gst-plugin/src/gstbcmdec.c 
 b/filters/gst/gst-plugin/src/gstbcmdec.c
 index ed01c14..a51bd59 100644
 --- a/filters/gst/gst-plugin/src/gstbcmdec.c
 +++ b/filters/gst/gst-plugin/src/gstbcmdec.c
 @@ -8,6 +8,7 @@
   *  AU
   *
   *  HISTORY:
 + * Updated for 1.0 by Guido Guenther a...@sigxcpu.org
   *
   ***
   *
 @@ -40,6 +41,7 @@
  #include glib.h
  #include gst/base/gstadapter.h
  #include gst/video/video.h
 +#include gst/video/gstvideopool.h
  
  #ifdef HAVE_CONFIG_H
  #include config.h
 @@ -51,8 +53,8 @@
  #include parse.h
  #include gstbcmdec.h
  
 -GST_DEBUG_CATEGORY_STATIC (gst_bcmdec_debug);
 -#define GST_CAT_DEFAULT gst_bcmdec_debug
 +GST_DEBUG_CATEGORY_STATIC (gst_bcm_dec_debug);
 +#define GST_CAT_DEFAULT gst_bcm_dec_debug
  
  //#define YV12__
  
 @@ -64,16 +66,18 @@ static GstFlowReturn 
 bcmdec_send_buff_detect_error(GstBcmDec *bcmdec, GstBuffer
  guint8 flags)
  {
   BC_STATUS sts = BC_STS_SUCCESS;
 + GstMapInfo info;
  
   GST_DEBUG_OBJECT(bcmdec, Attempting to Send Buffer);
  
   sts = decif_send_buffer(bcmdec-decif, pbuffer, size, tCurrent, flags);
  
   if (sts != BC_STS_SUCCESS) {
 + gst_buffer_map(buf, info, GST_MAP_READ);
   GST_ERROR_OBJECT(bcmdec, proc input failed sts = %d, sts);
   GST_ERROR_OBJECT(bcmdec, Chain: timeStamp = %llu size = %d 
 data = %p,
 -  GST_BUFFER_TIMESTAMP(buf), 
 GST_BUFFER_SIZE(buf),
 -  GST_BUFFER_DATA (buf));
 +  GST_BUFFER_DTS(buf), info.size, info.data);
 + gst_buffer_unmap(buf, info);
   return GST_FLOW_ERROR;
   }
  
 @@ -92,7 +96,7 @@ enum {
  };
  
  
 -GLB_INST_STS *g_inst_sts = NULL;
 +static GLB_INST_STS *g_inst_sts = NULL;
  
  /*
   * the capabilities of the inputs and outputs.
 @@ -111,35 +115,29 @@ GstStaticPadTemplate sink_factory_bcm70012 = 
 GST_STATIC_PAD_TEMPLATE(sink, GST
  
  #ifdef YV12__
  static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
 GST_PAD_SRC, GST_PAD_ALWAYS,
 - GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YV12 
 },  width = (int) [ 1, MAX ], 
 + GST_STATIC_CAPS(video/x-raw,  format = (string) { YV12 },  
 width = (int) [ 1, MAX ], 
   height = (int) [ 1, MAX ],  framerate = 
 (fraction) [ 0/1, 2147483647/1 ]));
  #define BUF_MULT (12 / 8)
  #define BUF_MODE MODE420
  #else
  static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
 GST_PAD_SRC, GST_PAD_ALWAYS,
 - GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YUY2 } 
 ,  framerate = (fraction) [0,MAX], 
 - width = (int) [1,MAX],  height = (int) 
 [1,MAX];  video/x-raw-yuv, 
 - format = (fourcc) { UYVY } ,  framerate = 
 (fraction) [0,MAX],  width = (int) [1,MAX], 
 + GST_STATIC_CAPS(video/x-raw,  format = (string) { YUY2 } ,  
 framerate = (fraction) [0,MAX], 
 + width = (int) [1,MAX],  height = (int) 
 [1,MAX];  video/x-raw, 
 + format = (string) { UYVY } ,  framerate = 
 (fraction) [0,MAX],  width = (int) [1,MAX], 
   height = (int) [1,MAX]; ));
  #define BUF_MULT (16 / 8)
  #define BUF_MODE MODE422_YUY2
  #endif
  
 -GST_BOILERPLATE(GstBcmDec, gst_bcmdec, GstElement, GST_TYPE_ELEMENT);
 +G_DEFINE_TYPE(GstBcmDec, gst_bcm_dec, GST_TYPE_ELEMENT);
  
  /* GObject vmethod implementations */
  
 -static void 

[PATCH] crystalhd gst: Port to GStreamer 1.0 API

2013-03-11 Thread Guido Günther
---
Tested with totem as well as gst-launch. Any chance this can be applied
to http://git.linuxtv.org/jarod/crystalhd.git?
Cheers,
 -- Guido

 filters/gst/gst-plugin/configure.ac|8 +-
 filters/gst/gst-plugin/src/gstbcmdec.c |  431 
 filters/gst/gst-plugin/src/gstbcmdec.h |   68 ++---
 3 files changed, 248 insertions(+), 259 deletions(-)

diff --git a/filters/gst/gst-plugin/configure.ac 
b/filters/gst/gst-plugin/configure.ac
index 99b3713..a3c6467 100644
--- a/filters/gst/gst-plugin/configure.ac
+++ b/filters/gst/gst-plugin/configure.ac
@@ -1,9 +1,9 @@
 AC_INIT
 
 dnl versions of gstreamer and plugins-base
-GST_MAJORMINOR=0.10
-GST_REQUIRED=0.10.0
-GSTPB_REQUIRED=0.10.0
+GST_MAJORMINOR=1.0
+GST_REQUIRED=1.0
+GSTPB_REQUIRED=1.0
 
 dnl fill in your package name and version here
 dnl the fourth (nano) number should be 0 for a release, 1 for CVS,
@@ -56,7 +56,7 @@ dnl And we can also ask for the right version of gstreamer
 
 PKG_CHECK_MODULES(GST, \
   gstreamer-$GST_MAJORMINOR = $GST_REQUIRED
-  gstreamer-video-0.10,
+  gstreamer-video-1.0,
   HAVE_GST=yes,HAVE_GST=no)
 
 dnl Give error and exit if we don't have gstreamer
diff --git a/filters/gst/gst-plugin/src/gstbcmdec.c 
b/filters/gst/gst-plugin/src/gstbcmdec.c
index ed01c14..a51bd59 100644
--- a/filters/gst/gst-plugin/src/gstbcmdec.c
+++ b/filters/gst/gst-plugin/src/gstbcmdec.c
@@ -8,6 +8,7 @@
  *  AU
  *
  *  HISTORY:
+ * Updated for 1.0 by Guido Guenther a...@sigxcpu.org
  *
  ***
  *
@@ -40,6 +41,7 @@
 #include glib.h
 #include gst/base/gstadapter.h
 #include gst/video/video.h
+#include gst/video/gstvideopool.h
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -51,8 +53,8 @@
 #include parse.h
 #include gstbcmdec.h
 
-GST_DEBUG_CATEGORY_STATIC (gst_bcmdec_debug);
-#define GST_CAT_DEFAULT gst_bcmdec_debug
+GST_DEBUG_CATEGORY_STATIC (gst_bcm_dec_debug);
+#define GST_CAT_DEFAULT gst_bcm_dec_debug
 
 //#define YV12__
 
@@ -64,16 +66,18 @@ static GstFlowReturn 
bcmdec_send_buff_detect_error(GstBcmDec *bcmdec, GstBuffer
   guint8 flags)
 {
BC_STATUS sts = BC_STS_SUCCESS;
+   GstMapInfo info;
 
GST_DEBUG_OBJECT(bcmdec, Attempting to Send Buffer);
 
sts = decif_send_buffer(bcmdec-decif, pbuffer, size, tCurrent, flags);
 
if (sts != BC_STS_SUCCESS) {
+   gst_buffer_map(buf, info, GST_MAP_READ);
GST_ERROR_OBJECT(bcmdec, proc input failed sts = %d, sts);
GST_ERROR_OBJECT(bcmdec, Chain: timeStamp = %llu size = %d 
data = %p,
-GST_BUFFER_TIMESTAMP(buf), 
GST_BUFFER_SIZE(buf),
-GST_BUFFER_DATA (buf));
+GST_BUFFER_DTS(buf), info.size, info.data);
+   gst_buffer_unmap(buf, info);
return GST_FLOW_ERROR;
}
 
@@ -92,7 +96,7 @@ enum {
 };
 
 
-GLB_INST_STS *g_inst_sts = NULL;
+static GLB_INST_STS *g_inst_sts = NULL;
 
 /*
  * the capabilities of the inputs and outputs.
@@ -111,35 +115,29 @@ GstStaticPadTemplate sink_factory_bcm70012 = 
GST_STATIC_PAD_TEMPLATE(sink, GST
 
 #ifdef YV12__
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
GST_PAD_SRC, GST_PAD_ALWAYS,
-   GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YV12 
},  width = (int) [ 1, MAX ], 
+   GST_STATIC_CAPS(video/x-raw,  format = (string) { YV12 },  
width = (int) [ 1, MAX ], 
height = (int) [ 1, MAX ],  framerate = 
(fraction) [ 0/1, 2147483647/1 ]));
 #define BUF_MULT (12 / 8)
 #define BUF_MODE MODE420
 #else
 static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE(src, 
GST_PAD_SRC, GST_PAD_ALWAYS,
-   GST_STATIC_CAPS(video/x-raw-yuv,  format = (fourcc) { YUY2 } 
,  framerate = (fraction) [0,MAX], 
-   width = (int) [1,MAX],  height = (int) 
[1,MAX];  video/x-raw-yuv, 
-   format = (fourcc) { UYVY } ,  framerate = 
(fraction) [0,MAX],  width = (int) [1,MAX], 
+   GST_STATIC_CAPS(video/x-raw,  format = (string) { YUY2 } ,  
framerate = (fraction) [0,MAX], 
+   width = (int) [1,MAX],  height = (int) 
[1,MAX];  video/x-raw, 
+   format = (string) { UYVY } ,  framerate = 
(fraction) [0,MAX],  width = (int) [1,MAX], 
height = (int) [1,MAX]; ));
 #define BUF_MULT (16 / 8)
 #define BUF_MODE MODE422_YUY2
 #endif
 
-GST_BOILERPLATE(GstBcmDec, gst_bcmdec, GstElement, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE(GstBcmDec, gst_bcm_dec, GST_TYPE_ELEMENT);
 
 /* GObject vmethod implementations */
 
-static void gst_bcmdec_base_init(gpointer gclass)
+static void gst_bcm_dec_base_init(gpointer gclass)
 {
-   static GstElementDetails element_details;
BC_HW_CAPS hwCaps;
 
-   GST_DEBUG_OBJECT(gclass,