CMIOExtensionStream direction CMIOExtensionStreamDirectionSink

_streamSinkIn = [[CMIOExtensionStream alloc] initWithLocalizedName:localizedName
streamID:streamInputID 
direction:CMIOExtensionStreamDirectionSink clockType:CMIOExtensionStreamClockTypeHostTime
source:self];

Attempting to publish a CMIOExtensionStream with the 'sink' direction (i.e. print-to-tape) as alluded to in Brad Ford's presentation. Any attempt to create such a stream yields and invalid argument exception and if you examine the header files all the init methods are described as returning stream instances that source data (ie camera publishers).

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid argument'

Replies

This is a good example of how to add a sink stream: https://github.com/MarkBesseyAT/CameraTest/tree/b7c2923b209ad567c55d35bff959fa2b514c341b

Well, it's an example of setting up the sink stream. It doesn't do anything with it yet - I'm still working that part out.

Thanks @MarkBessey in Advance , Can we add or remove device name from list of App on some action. Is this possible any how?

@DrXibber and @Amallik and @MarkBessey I posted a full example of how to declare a source and sink streams, and how to feed the sink sample buffers from the main app.

https://github.com/ldenoue/cameraextension

@Idenoue , Thanks for sample code. Your code working fine . I have one query, can we do something like , when our App running at that time only its shows in Third party App like quicktime. When I close my App it Remove from device list of third party App.

We have to install/uninstall only one time.

 I have one query, can we do something like , when our App running at that time only its shows in Third party App like quicktime. When I close my App it Remove from device list of third party App.

I have implemented this that way:

  1. The host app periodically send information about active devices to extension (just JSON format)
  2. Extension checks active devices and adds/removes devices according the list of p. 1
  3. Extension periodically checks the last time the list of active devices was sent and if time interval is more than defined (let's say more that 5 sec), extension removes all devices.

The transport was used to send the list of active devices - custom device property. The only problem - you should keep one device as "control device". Probably communication is possible using Extension Provider custom properties but I cannot access them from the host app.

Each stream should have its own streamID:

streamID:[[NSUUID alloc] init]