saperasrc: run gst-indent

This commit is contained in:
Joshua M. Doe 2014-12-11 14:48:25 -05:00
parent d7851d627f
commit 9a971a9fb3

View File

@ -47,12 +47,15 @@ gboolean gst_saperasrc_destroy_objects (GstSaperaSrc * src);
class SapMyProcessing : public SapProcessing class SapMyProcessing : public SapProcessing
{ {
public: public:
SapMyProcessing (SapBuffer *pBuffers, SapProCallback pCallback, void *pContext) SapMyProcessing (SapBuffer * pBuffers, SapProCallback pCallback,
: SapProcessing (pBuffers, pCallback, pContext) { void *pContext)
: SapProcessing (pBuffers, pCallback, pContext)
{
src = (GstSaperaSrc *) pContext; src = (GstSaperaSrc *) pContext;
} }
virtual ~SapMyProcessing () { virtual ~ SapMyProcessing ()
{
if (m_bInitOK) if (m_bInitOK)
Destroy (); Destroy ();
} }
@ -69,7 +72,8 @@ protected:
return TRUE; return TRUE;
} }
gboolean push_buffer () { gboolean push_buffer ()
{
void *pData; void *pData;
GstMapInfo minfo; GstMapInfo minfo;
@ -87,7 +91,8 @@ protected:
GstClock *clock = gst_element_get_clock (GST_ELEMENT (src)); GstClock *clock = gst_element_get_clock (GST_ELEMENT (src));
GST_BUFFER_TIMESTAMP (buf) = GST_BUFFER_TIMESTAMP (buf) =
GST_CLOCK_DIFF (gst_element_get_base_time (GST_ELEMENT (src)), gst_clock_get_time (clock)); GST_CLOCK_DIFF (gst_element_get_base_time (GST_ELEMENT (src)),
gst_clock_get_time (clock));
gst_object_unref (clock); gst_object_unref (clock);
// TODO: define duration? // TODO: define duration?
@ -98,7 +103,6 @@ protected:
GST_ERROR_OBJECT (src, "Failed to map buffer"); GST_ERROR_OBJECT (src, "Failed to map buffer");
return FALSE; return FALSE;
} }
// TODO: optimize this // TODO: optimize this
if (pitch == src->gst_stride) { if (pitch == src->gst_stride) {
memcpy (minfo.data, pData, size); memcpy (minfo.data, pData, size);
@ -113,7 +117,8 @@ protected:
gst_buffer_unmap (buf, &minfo); gst_buffer_unmap (buf, &minfo);
GST_DEBUG ("push_buffer => pts %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); GST_DEBUG ("push_buffer => pts %" GST_TIME_FORMAT,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
g_mutex_lock (&src->buffer_mutex); g_mutex_lock (&src->buffer_mutex);
if (src->buffer != NULL) if (src->buffer != NULL)
@ -129,7 +134,8 @@ protected:
GstSaperaSrc * src; GstSaperaSrc * src;
}; };
void gst_saperasrc_xfer_callback (SapXferCallbackInfo *pInfo) void
gst_saperasrc_xfer_callback (SapXferCallbackInfo * pInfo)
{ {
GstSaperaSrc *src = (GstSaperaSrc *) pInfo->GetContext (); GstSaperaSrc *src = (GstSaperaSrc *) pInfo->GetContext ();
@ -141,27 +147,34 @@ void gst_saperasrc_xfer_callback (SapXferCallbackInfo *pInfo)
} }
} }
void gst_saperasrc_pro_callback (SapProCallbackInfo *pInfo) void
gst_saperasrc_pro_callback (SapProCallbackInfo * pInfo)
{ {
GstSaperaSrc *src = (GstSaperaSrc *) pInfo->GetContext (); GstSaperaSrc *src = (GstSaperaSrc *) pInfo->GetContext ();
/* TODO: handle buffer */ /* TODO: handle buffer */
} }
void gst_saperasrc_init_objects (GstSaperaSrc * src) void
gst_saperasrc_init_objects (GstSaperaSrc * src)
{ {
GST_DEBUG_OBJECT (src, "Resource count: %d", SapManager::GetResourceCount(1, SapManager::ResourceAcq)); GST_DEBUG_OBJECT (src, "Resource count: %d", SapManager::GetResourceCount (1,
SapManager::ResourceAcq));
SapLocation loc (1, 0); SapLocation loc (1, 0);
src->sap_acq = new SapAcquisition (loc, src->format_file); src->sap_acq = new SapAcquisition (loc, src->format_file);
/* TODO: allow configuring buffer count? */ /* TODO: allow configuring buffer count? */
src->sap_buffers = new SapBufferWithTrash (3, src->sap_acq); src->sap_buffers = new SapBufferWithTrash (3, src->sap_acq);
src->sap_xfer = new SapAcqToBuf(src->sap_acq, src->sap_buffers, gst_saperasrc_xfer_callback, src); src->sap_xfer =
new SapAcqToBuf (src->sap_acq, src->sap_buffers,
gst_saperasrc_xfer_callback, src);
// TODO: handle bayer // TODO: handle bayer
//src->sap_bayer = new SapBayer(m_Acq, m_Buffers); //src->sap_bayer = new SapBayer(m_Acq, m_Buffers);
src->sap_pro = new SapMyProcessing (src->sap_buffers, gst_saperasrc_pro_callback, src); src->sap_pro =
new SapMyProcessing (src->sap_buffers, gst_saperasrc_pro_callback, src);
} }
gboolean gst_saperasrc_create_objects (GstSaperaSrc * src) gboolean
gst_saperasrc_create_objects (GstSaperaSrc * src)
{ {
UINT32 video_type = 0; UINT32 video_type = 0;
@ -229,24 +242,27 @@ gboolean gst_saperasrc_create_objects (GstSaperaSrc * src)
return TRUE; return TRUE;
} }
gboolean gst_saperasrc_destroy_objects (GstSaperaSrc * src) gboolean
gst_saperasrc_destroy_objects (GstSaperaSrc * src)
{ {
if (src->sap_xfer && *src->sap_xfer) src->sap_xfer->Destroy (); if (src->sap_xfer && *src->sap_xfer)
src->sap_xfer->Destroy ();
if (src->sap_pro && *src->sap_pro) src->sap_pro->Destroy (); if (src->sap_pro && *src->sap_pro)
src->sap_pro->Destroy ();
// TODO: handle bayer // TODO: handle bayer
//if (src->sap_bayer && *src->sap_bayer) src->sap_bayer->Destroy (); //if (src->sap_bayer && *src->sap_bayer) src->sap_bayer->Destroy ();
if (src->sap_buffers && *src->sap_buffers) src->sap_buffers->Destroy (); if (src->sap_buffers && *src->sap_buffers)
src->sap_buffers->Destroy ();
if (src->sap_acq && *src->sap_acq) src->sap_acq->Destroy (); if (src->sap_acq && *src->sap_acq)
src->sap_acq->Destroy ();
return TRUE; return TRUE;
} }
G_BEGIN_DECLS
/* prototypes */ /* prototypes */
static void gst_saperasrc_set_property (GObject * object, static void gst_saperasrc_set_property (GObject * object,
guint property_id, const GValue * value, GParamSpec * pspec); guint property_id, const GValue * value, GParamSpec * pspec);
@ -260,13 +276,10 @@ static gboolean gst_saperasrc_stop (GstBaseSrc * src);
static GstCaps *gst_saperasrc_get_caps (GstBaseSrc * src, GstCaps * filter); static GstCaps *gst_saperasrc_get_caps (GstBaseSrc * src, GstCaps * filter);
static gboolean gst_saperasrc_set_caps (GstBaseSrc * src, GstCaps * caps); static gboolean gst_saperasrc_set_caps (GstBaseSrc * src, GstCaps * caps);
static GstFlowReturn gst_saperasrc_create (GstPushSrc * src, static GstFlowReturn gst_saperasrc_create (GstPushSrc * src, GstBuffer ** buf);
GstBuffer ** buf);
static GstCaps *gst_saperasrc_create_caps (GstSaperaSrc * src); static GstCaps *gst_saperasrc_create_caps (GstSaperaSrc * src);
G_END_DECLS
enum enum
{ {
PROP_0, PROP_0,