summaryrefslogtreecommitdiff
path: root/sys/applemedia/avfvideosrc.m
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2013-04-24 22:22:28 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-20 13:31:02 +0200
commit9b168e6b4d0a1a4dfe8bbcd98bd1c4b6e456be0b (patch)
tree9618f6adba531d2119bfa79c0dae35ec8dece4a0 /sys/applemedia/avfvideosrc.m
parent97bb1edf6c8c13dbede03be13b25ba1d5a6a4d6f (diff)
downloadgstreamer-plugins-bad-9b168e6b4d0a1a4dfe8bbcd98bd1c4b6e456be0b.tar.gz
applemedia: remove the unneeded buffer factory
Diffstat (limited to 'sys/applemedia/avfvideosrc.m')
-rw-r--r--sys/applemedia/avfvideosrc.m23
1 files changed, 2 insertions, 21 deletions
diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m
index 3c570b1a6..d2db4a883 100644
--- a/sys/applemedia/avfvideosrc.m
+++ b/sys/applemedia/avfvideosrc.m
@@ -19,10 +19,9 @@
#include "avfvideosrc.h"
-#import "bufferfactory.h"
-
#import <AVFoundation/AVFoundation.h>
#include <gst/video/video.h>
+#include "coremediabuffer.h"
#define DEFAULT_DEVICE_INDEX -1
#define DEFAULT_DO_STATS FALSE
@@ -82,7 +81,6 @@ static GstPushSrcClass * parent_class;
gint deviceIndex;
BOOL doStats;
- GstAMBufferFactory *bufferFactory;
AVCaptureSession *session;
AVCaptureDeviceInput *input;
AVCaptureVideoDataOutput *output;
@@ -176,15 +174,6 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
- (BOOL)openDevice
{
BOOL success = NO, *successPtr = &success;
- GError *error;
-
- bufferFactory = [[GstAMBufferFactory alloc] initWithError:&error];
- if (bufferFactory == nil) {
- GST_ELEMENT_ERROR (element, RESOURCE, FAILED, ("API error"),
- ("%s", error->message));
- g_clear_error (&error);
- return NO;
- }
dispatch_async (mainQueue, ^{
NSString *mediaType = AVMediaTypeVideo;
@@ -239,11 +228,6 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
});
[self waitForMainQueueToDrain];
- if (!success) {
- [bufferFactory release];
- bufferFactory = nil;
- }
-
return success;
}
@@ -268,9 +252,6 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
device = nil;
});
[self waitForMainQueueToDrain];
-
- [bufferFactory release];
- bufferFactory = nil;
}
#define GST_AVF_CAPS_NEW(format, w, h) \
@@ -513,7 +494,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
[bufQueueLock unlockWithCondition:
([bufQueue count] == 0) ? NO_BUFFERS : HAS_BUFFER_OR_STOP_REQUEST];
- *buf = [bufferFactory createGstBufferForSampleBuffer:sbuf];
+ *buf = gst_core_media_buffer_new (sbuf);
CFRelease (sbuf);
[self timestampBuffer:*buf];