saperasrc: run gst-indent
This commit is contained in:
parent
d7851d627f
commit
9a971a9fb3
@ -47,12 +47,15 @@ gboolean gst_saperasrc_destroy_objects (GstSaperaSrc * src);
|
||||
class SapMyProcessing : public SapProcessing
|
||||
{
|
||||
public:
|
||||
SapMyProcessing (SapBuffer *pBuffers, SapProCallback pCallback, void *pContext)
|
||||
: SapProcessing (pBuffers, pCallback, pContext) {
|
||||
SapMyProcessing (SapBuffer * pBuffers, SapProCallback pCallback,
|
||||
void *pContext)
|
||||
: SapProcessing (pBuffers, pCallback, pContext)
|
||||
{
|
||||
src = (GstSaperaSrc *) pContext;
|
||||
}
|
||||
|
||||
virtual ~SapMyProcessing () {
|
||||
virtual ~ SapMyProcessing ()
|
||||
{
|
||||
if (m_bInitOK)
|
||||
Destroy ();
|
||||
}
|
||||
@ -69,7 +72,8 @@ protected:
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean push_buffer () {
|
||||
gboolean push_buffer ()
|
||||
{
|
||||
void *pData;
|
||||
GstMapInfo minfo;
|
||||
|
||||
@ -87,7 +91,8 @@ protected:
|
||||
|
||||
GstClock *clock = gst_element_get_clock (GST_ELEMENT (src));
|
||||
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);
|
||||
|
||||
// TODO: define duration?
|
||||
@ -98,7 +103,6 @@ protected:
|
||||
GST_ERROR_OBJECT (src, "Failed to map buffer");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// TODO: optimize this
|
||||
if (pitch == src->gst_stride) {
|
||||
memcpy (minfo.data, pData, size);
|
||||
@ -113,7 +117,8 @@ protected:
|
||||
|
||||
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);
|
||||
if (src->buffer != NULL)
|
||||
@ -129,7 +134,8 @@ protected:
|
||||
GstSaperaSrc * src;
|
||||
};
|
||||
|
||||
void gst_saperasrc_xfer_callback (SapXferCallbackInfo *pInfo)
|
||||
void
|
||||
gst_saperasrc_xfer_callback (SapXferCallbackInfo * pInfo)
|
||||
{
|
||||
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 ();
|
||||
|
||||
/* 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);
|
||||
src->sap_acq = new SapAcquisition (loc, src->format_file);
|
||||
/* TODO: allow configuring buffer count? */
|
||||
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
|
||||
//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;
|
||||
|
||||
@ -229,24 +242,27 @@ gboolean gst_saperasrc_create_objects (GstSaperaSrc * src)
|
||||
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
|
||||
//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;
|
||||
}
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* prototypes */
|
||||
static void gst_saperasrc_set_property (GObject * object,
|
||||
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 gboolean gst_saperasrc_set_caps (GstBaseSrc * src, GstCaps * caps);
|
||||
|
||||
static GstFlowReturn gst_saperasrc_create (GstPushSrc * src,
|
||||
GstBuffer ** buf);
|
||||
static GstFlowReturn gst_saperasrc_create (GstPushSrc * src, GstBuffer ** buf);
|
||||
|
||||
static GstCaps *gst_saperasrc_create_caps (GstSaperaSrc * src);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user