Commit c0dfcfde authored by jehan's avatar jehan
Browse files

add debugging code to videotoolbox for dumping supported encoder properties

parent 49798af3
......@@ -107,7 +107,14 @@ static void h264_enc_output_cb(VTH264EncCtx *ctx, void *sourceFrameRefCon, OSSta
#if 0
static void print_properties(CFStringRef prop_name, CFDictionaryRef prop_attrs, void *context) {
if (CFDictionaryGetCount(prop_attrs) >0)
static void h264_enc_configure(VTH264EncCtx *ctx) {
OSStatus err;
const char *error_msg = "Could not initialize the VideoToolbox compresson session";
......@@ -127,7 +134,18 @@ static void h264_enc_configure(VTH264EncCtx *ctx) {
ms_error("%s: error code %d", error_msg, (int)err);
goto fail;
#if 0 /*for debugin purpose*/
CFDictionaryRef dict;
err = VTSessionCopySupportedPropertyDictionary (ctx->session, &dict);
if (err == noErr) {
CFDictionaryApplyFunction (dict,
(CFDictionaryApplierFunction) print_properties, ctx);
CFRelease (dict);
} else {
ms_error("Could not get VTSessionCopySupportedPropertyDictionary, err=%i",(int)err);
VTSessionSetProperty(ctx->session, kVTCompressionPropertyKey_ProfileLevel, kVTProfileLevel_H264_Baseline_AutoLevel);
VTSessionSetProperty(ctx->session, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse);
value = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &ctx->conf.required_bitrate);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment