本文整理汇总了C++中sp::getDetails方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::getDetails方法的具体用法?C++ sp::getDetails怎么用?C++ sp::getDetails使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::getDetails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMeasureBitrate
static void getMeasureBitrate(const sp<MediaCodecInfo::Capabilities> &caps, int32_t *bitrate) {
// Until have native MediaCodecInfo, we cannot get bitrates based on profile/levels.
// We use 200000 as default value for our measurement.
*bitrate = 200000;
AString bitrateRange;
if (!caps->getDetails()->findString("bitrate-range", &bitrateRange)) {
return;
}
AString minBitrate;
AString maxBitrate;
if (!splitString(bitrateRange, "-", &minBitrate, &maxBitrate)) {
return;
}
*bitrate = strtol(minBitrate.c_str(), NULL, 10);
}
示例2: getMeasureSize
// TODO: move MediaCodecInfo to C++. Until then, some temp methods to parse out info.
static bool getMeasureSize(const sp<MediaCodecInfo::Capabilities> &caps, int32_t *width, int32_t *height) {
AString sizeRange;
if (!caps->getDetails()->findString("size-range", &sizeRange)) {
return false;
}
AString minSize;
AString maxSize;
if (!splitString(sizeRange, "-", &minSize, &maxSize)) {
return false;
}
AString sWidth;
AString sHeight;
if (!splitString(minSize, "x", &sWidth, &sHeight)) {
if (!splitString(minSize, "*", &sWidth, &sHeight)) {
return false;
}
}
*width = strtol(sWidth.c_str(), NULL, 10);
*height = strtol(sHeight.c_str(), NULL, 10);
return (*width > 0) && (*height > 0);
}