applemedia: rewrite VideoToolbox decoder based on GstVideoDecoder
This commit is contained in:
parent
4a5a1e568e
commit
b1a756fda7
@ -54,6 +54,10 @@ libgstapplemedia_la_LDFLAGS = \
|
|||||||
-Wl,-framework -Wl,CoreVideo \
|
-Wl,-framework -Wl,CoreVideo \
|
||||||
-Wl,-framework -Wl,AudioToolbox
|
-Wl,-framework -Wl,AudioToolbox
|
||||||
|
|
||||||
|
if !HAVE_IOS
|
||||||
|
libgstapplemedia_la_LDFLAGS += -Wl,-framework -Wl,VideoToolbox
|
||||||
|
endif
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
qtkitvideosrc.h \
|
qtkitvideosrc.h \
|
||||||
avfvideosrc.h \
|
avfvideosrc.h \
|
||||||
|
@ -32,11 +32,12 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "vth264decbin.h"
|
#include "vth264decbin.h"
|
||||||
#include "vth264encbin.h"
|
#include "vth264encbin.h"
|
||||||
#include "vtenc.h"
|
|
||||||
#include "vtdec.h"
|
#include "vtdec.h"
|
||||||
#include "atdec.h"
|
#include "atdec.h"
|
||||||
|
|
||||||
#ifndef HAVE_IOS
|
#ifndef HAVE_IOS
|
||||||
|
void gst_vtenc_register_elements (GstPlugin * plugin);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
enable_mt_mode (void)
|
enable_mt_mode (void)
|
||||||
{
|
{
|
||||||
@ -76,8 +77,8 @@ plugin_init (GstPlugin * plugin)
|
|||||||
res &= gst_element_register (plugin, "atdec", GST_RANK_PRIMARY, GST_TYPE_ATDEC);
|
res &= gst_element_register (plugin, "atdec", GST_RANK_PRIMARY, GST_TYPE_ATDEC);
|
||||||
|
|
||||||
#ifndef HAVE_IOS
|
#ifndef HAVE_IOS
|
||||||
|
res &= gst_element_register (plugin, "vtdec", GST_RANK_PRIMARY, GST_TYPE_VTDEC);
|
||||||
gst_vtenc_register_elements (plugin);
|
gst_vtenc_register_elements (plugin);
|
||||||
gst_vtdec_register_elements (plugin);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,6 @@
|
|||||||
/*
|
/* GStreamer
|
||||||
* Copyright (C) 2010 Ole André Vadla Ravnås <oleavr@soundrop.com>
|
* Copyright (C) 2010, 2013 Ole André Vadla Ravnås <oleavr@soundrop.com>
|
||||||
|
* Copyright (C) 2012, 2013 Alessandro Decina <alessandro.d@gmail.com>
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Library General Public
|
* modify it under the terms of the GNU Library General Public
|
||||||
@ -17,62 +18,42 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GST_VTDEC_H__
|
#ifndef _GST_VTDEC_H_
|
||||||
#define __GST_VTDEC_H__
|
#define _GST_VTDEC_H_
|
||||||
|
|
||||||
#include <gst/gst.h>
|
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
|
#include <gst/video/gstvideodecoder.h>
|
||||||
#include "coremediactx.h"
|
#include <CoreMedia/CoreMedia.h>
|
||||||
|
#include <VideoToolbox/VideoToolbox.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_VTDEC_CAST(obj) \
|
#define GST_TYPE_VTDEC (gst_vtdec_get_type())
|
||||||
((GstVTDec *) (obj))
|
#define GST_VTDEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VTDEC,GstVtdec))
|
||||||
#define GST_VTDEC_CLASS_GET_CODEC_DETAILS(klass) \
|
#define GST_VTDEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VTDEC,GstVtdecClass))
|
||||||
((const GstVTDecoderDetails *) g_type_get_qdata (G_OBJECT_CLASS_TYPE (klass), \
|
#define GST_IS_VTDEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VTDEC))
|
||||||
GST_VTDEC_CODEC_DETAILS_QDATA))
|
#define GST_IS_VTDEC_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VTDEC))
|
||||||
|
|
||||||
typedef struct _GstVTDecoderDetails GstVTDecoderDetails;
|
typedef struct _GstVtdec GstVtdec;
|
||||||
|
typedef struct _GstVtdecClass GstVtdecClass;
|
||||||
|
|
||||||
typedef struct _GstVTDecClassParams GstVTDecClassParams;
|
struct _GstVtdec
|
||||||
typedef struct _GstVTDecClass GstVTDecClass;
|
|
||||||
typedef struct _GstVTDec GstVTDec;
|
|
||||||
|
|
||||||
struct _GstVTDecoderDetails
|
|
||||||
{
|
{
|
||||||
const gchar * name;
|
GstVideoDecoder base_vtdec;
|
||||||
const gchar * element_name;
|
GstVideoInfo video_info;
|
||||||
const gchar * mimetype;
|
CMFormatDescriptionRef format_description;
|
||||||
VTFormatId format_id;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GstVTDecClass
|
|
||||||
{
|
|
||||||
GstElementClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _GstVTDec
|
|
||||||
{
|
|
||||||
GstElement parent;
|
|
||||||
|
|
||||||
const GstVTDecoderDetails * details;
|
|
||||||
|
|
||||||
GstPad * sinkpad;
|
|
||||||
GstPad * srcpad;
|
|
||||||
|
|
||||||
GstCoreMediaCtx * ctx;
|
|
||||||
|
|
||||||
GstVideoInfo vinfo;
|
|
||||||
CMFormatDescriptionRef fmt_desc;
|
|
||||||
VTDecompressionSessionRef session;
|
VTDecompressionSessionRef session;
|
||||||
|
GAsyncQueue *reorder_queue;
|
||||||
GQueue * cur_outbufs;
|
gint reorder_queue_frame_delay;
|
||||||
gboolean flush;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void gst_vtdec_register_elements (GstPlugin * plugin);
|
struct _GstVtdecClass
|
||||||
|
{
|
||||||
|
GstVideoDecoderClass base_vtdec_class;
|
||||||
|
};
|
||||||
|
|
||||||
|
GType gst_vtdec_get_type (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GST_VTDEC_H__ */
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user