blob: 0683ea79e56ce67b212f894eabbdb1476e9b9f4f [file] [log] [blame]
magjed73c0eb52017-08-07 06:55:28 -07001/*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 *
10 */
11
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020012#ifndef SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_HELPERS_H_
13#define SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_HELPERS_H_
magjed73c0eb52017-08-07 06:55:28 -070014
15#include <CoreFoundation/CoreFoundation.h>
16#include <VideoToolbox/VideoToolbox.h>
17#include <string>
18
19// Convenience function for creating a dictionary.
20inline CFDictionaryRef CreateCFTypeDictionary(CFTypeRef* keys,
21 CFTypeRef* values,
22 size_t size) {
23 return CFDictionaryCreate(kCFAllocatorDefault, keys, values, size,
24 &kCFTypeDictionaryKeyCallBacks,
25 &kCFTypeDictionaryValueCallBacks);
26}
27
28// Copies characters from a CFStringRef into a std::string.
29std::string CFStringToString(const CFStringRef cf_string);
30
31// Convenience function for setting a VT property.
32void SetVTSessionProperty(VTSessionRef session, CFStringRef key, int32_t value);
33
34// Convenience function for setting a VT property.
35void SetVTSessionProperty(VTSessionRef session,
36 CFStringRef key,
37 uint32_t value);
38
39// Convenience function for setting a VT property.
40void SetVTSessionProperty(VTSessionRef session, CFStringRef key, bool value);
41
42// Convenience function for setting a VT property.
43void SetVTSessionProperty(VTSessionRef session,
44 CFStringRef key,
45 CFStringRef value);
46
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020047#endif // SDK_OBJC_FRAMEWORK_CLASSES_VIDEOTOOLBOX_HELPERS_H_