Reputation: 947
I have a IMFMediaSink interface implemented that encodes through the native h264 codec a particular source (we're talking about the Windows 8 Modern (Metro) interface). I want to change the default options of the h264 codec, how to do that?
I searched online and I kind of understand that the ICodecAPI interface is something related to what I want to do, but how to use it? Does anyone have some sample code to look at to try and understand what to do?
I know I can use the MF_SINK_WRITER_ENCODER_CONFIG for a sinkwriter, but I'm not using that class unfortunately.
Upvotes: 2
Views: 815
Reputation: 947
Hey, I did hear back from our architect. He cofirmed that the current implientation is "by design". The team is aware of the limitaion but I'm not sure if they will be able to consider a design change. I hope this helps, James
I found the solution myself. It doesn't exist a way to access ICodecAPI from WinRT Metro. This is by design and Microsoft don't think will change it anytime soon. It's a shame...:(
Upvotes: 2
Reputation: 51
Maybe like this:
Try getting an IMFStreamSink
on your h264 stream from the IMFMediaSink
. GetStremSinkCount
and GetStreamSinkByIndex
should help you on that.
Then call GetMediaTypeHandler
on IMFMediaSink
object.
Call GetCurrentMediaType
on IMFMediaTypeHandler
.
Now you should have a pointer to an IMFMediaType
, which is derived from the IMFAttributes
. You should be able to configure your transformer here.
Upvotes: 3