• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*--------------------------------------------------------------------------
2 Copyright (c) 2017, The Linux Foundation. All rights reserved.
3 
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are
6 met:
7     * Redistributions of source code must retain the above copyright
8       notice, this list of conditions and the following disclaimer.
9     * Redistributions in binary form must reproduce the above
10       copyright notice, this list of conditions and the following
11       disclaimer in the documentation and/or other materials provided
12       with the distribution.
13     * Neither the name of The Linux Foundation nor the names of its
14       contributors may be used to endorse or promote products derived
15       from this software without specific prior written permission.
16 
17 THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
18 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
20 ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
21 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 --------------------------------------------------------------------------*/
29 
30 enum {
31     BLUR_STRENGTH_NONE     = 0,
32     BLUR_STRENGTH_MAX1080  = 25,
33     BLUR_STRENGTH_MAX720   = 50,
34     BLUR_STRENGTH_MAX480   = 75,
35     BLUR_STRENGTH_MAX240   = 100,
36 };
37 
init_vendor_extensions(VendorExtensionStore & store)38 void omx_video::init_vendor_extensions(VendorExtensionStore &store) {
39 
40     //TODO: add extensions based on Codec, m_platform and/or other capability queries
41 
42     ADD_EXTENSION("qti-ext-enc-preprocess-rotate", OMX_IndexConfigCommonRotate, OMX_DirOutput)
43     ADD_PARAM_END("angle", OMX_AndroidVendorValueInt32)
44 
45     ADD_EXTENSION("qti-ext-enc-preprocess-mirror", OMX_IndexConfigCommonMirror, OMX_DirOutput)
46     ADD_PARAM_END("flip", OMX_AndroidVendorValueInt32)
47 
48     ADD_EXTENSION("qti-ext-enc-avc-intra-period", QOMX_IndexConfigVideoIntraperiod, OMX_DirOutput)
49     ADD_PARAM    ("n-pframes",    OMX_AndroidVendorValueInt32)
50     ADD_PARAM_END("n-idr-period", OMX_AndroidVendorValueInt32)
51 
52     ADD_EXTENSION("qti-ext-enc-intra-period", QOMX_IndexConfigVideoIntraperiod, OMX_DirOutput)
53     ADD_PARAM    ("n-pframes",    OMX_AndroidVendorValueInt32)
54     ADD_PARAM    ("n-bframes",    OMX_AndroidVendorValueInt32)
55     ADD_PARAM_END("n-idr-period", OMX_AndroidVendorValueInt32)
56 
57     ADD_EXTENSION("qti-ext-enc-error-correction", OMX_QcomIndexParamVideoSliceSpacing, OMX_DirOutput)
58     ADD_PARAM_END("resync-marker-spacing-bits", OMX_AndroidVendorValueInt32)
59 
60     ADD_EXTENSION("qti-ext-enc-slice", OMX_QcomIndexParamVideoSliceSpacing, OMX_DirOutput)
61     ADD_PARAM_END("spacing", OMX_AndroidVendorValueInt32)
62 
63     ADD_EXTENSION("qti-ext-enc-custom-profile-level", OMX_IndexParamVideoProfileLevelCurrent, OMX_DirOutput)
64     ADD_PARAM    ("profile", OMX_AndroidVendorValueInt32)
65     ADD_PARAM_END("level",   OMX_AndroidVendorValueInt32)
66 
67     ADD_EXTENSION("qti-ext-enc-timestamp-source-avtimer", OMX_QTIIndexParamEnableAVTimerTimestamps, OMX_DirInput)
68     ADD_PARAM_END("enable", OMX_AndroidVendorValueInt32)
69 
70     ADD_EXTENSION("qti-ext-enc-frame-qp", OMX_QcomIndexConfigQp, OMX_DirOutput)
71     ADD_PARAM_END("value", OMX_AndroidVendorValueInt32)
72 
73     ADD_EXTENSION("qti-ext-down-scalar", OMX_QcomIndexParamVideoDownScalar, OMX_DirOutput)
74     ADD_PARAM    ("output-width", OMX_AndroidVendorValueInt32)
75     ADD_PARAM_END("output-height", OMX_AndroidVendorValueInt32)
76 
77     ADD_EXTENSION("qti-ext-enc-app-input-control", OMX_QcomIndexParamVencControlInputQueue, OMX_DirInput)
78     ADD_PARAM_END("enable", OMX_AndroidVendorValueInt32)
79 
80     ADD_EXTENSION("qti-ext-enc-input-trigger", OMX_IndexConfigTimePosition, OMX_DirInput)
81     ADD_PARAM_END("timestamp", OMX_AndroidVendorValueInt64)
82 
83     ADD_EXTENSION("qti-ext-enc-low-latency", OMX_QTIIndexParamLowLatencyMode, OMX_DirInput)
84     ADD_PARAM_END("enable", OMX_AndroidVendorValueInt32)
85 
86     ADD_EXTENSION("qti-ext-enc-base-layer-pid", OMX_QcomIndexConfigBaseLayerId, OMX_DirInput)
87     ADD_PARAM_END("value", OMX_AndroidVendorValueInt32)
88 
89     ADD_EXTENSION("qti-ext-enc-ltr-count", OMX_QcomIndexParamVideoLTRCount, OMX_DirOutput)
90     ADD_PARAM_END("num-ltr-frames", OMX_AndroidVendorValueInt32)
91 
92     ADD_EXTENSION("qti-ext-enc-ltr", OMX_QcomIndexConfigVideoLTRUse, OMX_DirInput)
93     ADD_PARAM_END("use-frame", OMX_AndroidVendorValueInt32)
94 
95     ADD_EXTENSION("qti-ext-enc-ltr", OMX_QcomIndexConfigVideoLTRMark, OMX_DirInput)
96     ADD_PARAM_END("mark-frame", OMX_AndroidVendorValueInt32)
97 
98     ADD_EXTENSION("qti-ext-enc-dynamic-frame-rate", OMX_IndexConfigVideoFramerate, OMX_DirOutput)
99     ADD_PARAM_END("frame-rate", OMX_AndroidVendorValueInt32)
100 
101     ADD_EXTENSION("qti-ext-extradata-enable", OMX_QcomIndexParamIndexExtraDataType, OMX_DirOutput)
102     ADD_PARAM_END("types", OMX_AndroidVendorValueString)
103 
104     ADD_EXTENSION("qti-ext-enc-caps-vt-driver-version", OMX_QTIIndexParamCapabilitiesVTDriverVersion, OMX_DirOutput)
105     ADD_PARAM_END("number", OMX_AndroidVendorValueInt32)
106 
107     ADD_EXTENSION("qti-ext-enc-caps-preprocess", OMX_QTIIndexParamCapabilitiesMaxDownScaleRatio, OMX_DirOutput)
108     ADD_PARAM_END("max-downscale-factor", OMX_AndroidVendorValueInt32)
109 
110     ADD_EXTENSION("qti-ext-enc-caps-preprocess", OMX_QTIIndexParamCapabilitiesRotationSupport, OMX_DirOutput)
111     ADD_PARAM_END("rotation", OMX_AndroidVendorValueInt32)
112 
113     ADD_EXTENSION("qti-ext-enc-caps-ltr", OMX_QTIIndexParamCapabilitiesMaxLTR, OMX_DirOutput)
114     ADD_PARAM_END("max-count", OMX_AndroidVendorValueInt32)
115 
116     ADD_EXTENSION("qti-ext-enc-caps-temporal-layers", OMX_QTIIndexParamCapabilitiesMaxTemporalLayers, OMX_DirInput)
117     ADD_PARAM    ("max-p-count", OMX_AndroidVendorValueInt32)
118     ADD_PARAM_END("max-b-count", OMX_AndroidVendorValueInt32)
119 
120     ADD_EXTENSION("qti-ext-enc-colorspace-conversion", OMX_QTIIndexParamColorSpaceConversion, OMX_DirInput)
121     ADD_PARAM_END("enable", OMX_AndroidVendorValueInt32)
122 
123     ADD_EXTENSION("qti-ext-enc-initial-qp", QOMX_IndexParamVideoInitialQp, OMX_DirOutput)
124     ADD_PARAM    ("qp-i", OMX_AndroidVendorValueInt32)
125     ADD_PARAM    ("qp-i-enable", OMX_AndroidVendorValueInt32)
126     ADD_PARAM    ("qp-p", OMX_AndroidVendorValueInt32)
127     ADD_PARAM    ("qp-p-enable", OMX_AndroidVendorValueInt32)
128     ADD_PARAM    ("qp-b", OMX_AndroidVendorValueInt32)
129     ADD_PARAM_END("qp-b-enable", OMX_AndroidVendorValueInt32)
130 
131     ADD_EXTENSION("qti-ext-enc-blurfilter", OMX_QTIIndexConfigVideoBlurResolution, OMX_DirInput)
132     ADD_PARAM_END("strength", OMX_AndroidVendorValueInt32)
133 
134     ADD_EXTENSION("qti-ext-enc-qp-range", OMX_QcomIndexParamVideoIPBQPRange, OMX_DirOutput)
135     ADD_PARAM    ("qp-i-min", OMX_AndroidVendorValueInt32)
136     ADD_PARAM    ("qp-i-max", OMX_AndroidVendorValueInt32)
137     ADD_PARAM    ("qp-p-min", OMX_AndroidVendorValueInt32)
138     ADD_PARAM    ("qp-p-max", OMX_AndroidVendorValueInt32)
139     ADD_PARAM    ("qp-b-min", OMX_AndroidVendorValueInt32)
140     ADD_PARAM_END("qp-b-max", OMX_AndroidVendorValueInt32)
141 }
142 
get_vendor_extension_config(OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE * ext)143 OMX_ERRORTYPE omx_video::get_vendor_extension_config(
144                 OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE *ext) {
145     if (ext->nIndex >= mVendorExtensionStore.size()) {
146         return OMX_ErrorNoMore;
147     }
148 
149     const VendorExtension& vExt = mVendorExtensionStore[ext->nIndex];
150     DEBUG_PRINT_LOW("VendorExt: getConfig: index=%u (%s)", ext->nIndex, vExt.name());
151 
152     vExt.copyInfoTo(ext);
153     if (ext->nParamSizeUsed < vExt.paramCount()) {
154         // this happens during initial getConfig to query only extension-name and param-count
155         return OMX_ErrorNone;
156     }
157 
158     // We now have sufficient params allocated in extension data passed.
159     // Following code is to set the extension-specific data
160 
161     bool setStatus = true;
162 
163     switch ((OMX_U32)vExt.extensionIndex()) {
164         case OMX_IndexConfigCommonRotate:
165         {
166             setStatus &= vExt.setParamInt32(ext, "angle", m_sConfigFrameRotation.nRotation);
167             break;
168         }
169         case OMX_IndexConfigCommonMirror:
170         {
171             setStatus &= vExt.setParamInt32(ext, "flip", m_sConfigFrameMirror.eMirror);
172             break;
173         }
174         case QOMX_IndexConfigVideoIntraperiod:
175         {
176             if (vExt.isConfigKey(ext, "qti-ext-enc-avc-intra-period")) {
177                 setStatus &= vExt.setParamInt32(ext, "n-pframes", m_sIntraperiod.nPFrames);
178                 setStatus &= vExt.setParamInt32(ext, "n-idr-period", m_sIntraperiod.nIDRPeriod);
179             } else if (vExt.isConfigKey(ext, "qti-ext-enc-intra-period")) {
180                 setStatus &= vExt.setParamInt32(ext, "n-pframes", m_sIntraperiod.nPFrames);
181                 setStatus &= vExt.setParamInt32(ext, "n-bframes",  m_sIntraperiod.nBFrames);
182                 setStatus &= vExt.setParamInt32(ext, "n-idr-period", m_sIntraperiod.nIDRPeriod);
183             }
184             break;
185         }
186         case OMX_QcomIndexParamVideoSliceSpacing:
187         {
188             if (vExt.isConfigKey(ext, "qti-ext-enc-error-correction")) {
189                 setStatus &= vExt.setParamInt32(ext,
190                         "resync-marker-spacing-bits", m_sSliceSpacing.nSliceSize);
191             } else if (vExt.isConfigKey(ext, "qti-ext-enc-slice")) {
192                 setStatus &= vExt.setParamInt32(ext, "spacing", m_sSliceSpacing.nSliceSize);
193             }
194             break;
195         }
196         case OMX_IndexParamVideoProfileLevelCurrent:
197         {
198             setStatus &= vExt.setParamInt32(ext, "profile", m_sParamProfileLevel.eProfile);
199             setStatus &= vExt.setParamInt32(ext, "level", m_sParamProfileLevel.eLevel);
200 
201             break;
202         }
203         case OMX_QTIIndexParamEnableAVTimerTimestamps:
204         {
205             setStatus &= vExt.setParamInt32(ext, "enable", m_sParamAVTimerTimestampMode.bEnable);
206             break;
207         }
208         case OMX_QcomIndexConfigQp:
209         {
210             setStatus &= vExt.setParamInt32(ext, "value", m_sConfigQP.nQP);
211             break;
212         }
213         case OMX_QcomIndexParamVideoDownScalar:
214         {
215             setStatus &= vExt.setParamInt32(ext, "output-width", m_sParamDownScalar.nOutputWidth);
216             setStatus &= vExt.setParamInt32(ext, "output-height", m_sParamDownScalar.nOutputHeight);
217             break;
218         }
219         case OMX_QcomIndexParamVencControlInputQueue:
220         {
221             setStatus &= vExt.setParamInt32(ext, "enable", m_sParamControlInputQueue.bEnable);
222             break;
223         }
224         case OMX_IndexConfigTimePosition:
225         {
226             setStatus &= vExt.setParamInt64(ext, "timestamp", m_sConfigInputTrigTS.nTimestamp);
227             break;
228         }
229         case OMX_QTIIndexParamLowLatencyMode:
230         {
231             setStatus &= vExt.setParamInt32(ext, "enable", m_sParamLowLatency.bEnableLowLatencyMode);
232             break;
233         }
234         case OMX_QcomIndexConfigBaseLayerId:
235         {
236             setStatus &= vExt.setParamInt32(ext, "value", m_sBaseLayerID.nPID);
237             break;
238         }
239         case OMX_QcomIndexParamVideoLTRCount:
240         {
241             setStatus &= vExt.setParamInt32(ext, "num-ltr-frames", m_sParamLTRCount.nCount);
242             break;
243         }
244         case OMX_QcomIndexConfigVideoLTRUse:
245         {
246             setStatus &= vExt.setParamInt32(ext, "use-frame", m_sConfigLTRUse.nID);
247             break;
248         }
249         case OMX_QcomIndexConfigVideoLTRMark:
250         {
251             setStatus &= vExt.setParamInt32(ext, "mark-frame", m_sConfigLTRMark.nID);
252             break;
253         }
254         case OMX_IndexConfigVideoFramerate:
255         {
256             setStatus &= vExt.setParamInt32(ext, "frame-rate", m_sConfigFramerate.xEncodeFramerate);
257             break;
258         }
259         case  OMX_QcomIndexParamIndexExtraDataType:
260         {
261             char exType[OMX_MAX_STRINGVALUE_SIZE+1];
262             memset (exType,0, (sizeof(char)*OMX_MAX_STRINGVALUE_SIZE));
263             if ((OMX_BOOL)(m_sExtraData & VENC_EXTRADATA_LTRINFO)){
264                 const char *extraDataVideoLTRInfo = getStringForExtradataType(OMX_ExtraDataVideoLTRInfo);
265                 if(extraDataVideoLTRInfo != NULL &&
266                         (strlcat(exType, extraDataVideoLTRInfo,
267                                    OMX_MAX_STRINGVALUE_SIZE)) >= OMX_MAX_STRINGVALUE_SIZE) {
268                     DEBUG_PRINT_LOW("extradata string size exceeds size %d",OMX_MAX_STRINGVALUE_SIZE );
269                 }
270             }
271             if ((OMX_BOOL)(m_sExtraData & VENC_EXTRADATA_MBINFO)) {
272                 if (exType[0]!=0) {
273                     strlcat(exType,"|", OMX_MAX_STRINGVALUE_SIZE);
274                 }
275                 const char *extraDataVideoEncoderMBInfo = getStringForExtradataType(OMX_ExtraDataVideoEncoderMBInfo);
276                 if(extraDataVideoEncoderMBInfo != NULL &&
277                         (strlcat(exType, extraDataVideoEncoderMBInfo,
278                                  OMX_MAX_STRINGVALUE_SIZE)) >= OMX_MAX_STRINGVALUE_SIZE) {
279                     DEBUG_PRINT_LOW("extradata string size exceeds size %d",OMX_MAX_STRINGVALUE_SIZE );
280                 }
281             }
282             setStatus &= vExt.setParamString(ext, "types", exType);
283             DEBUG_PRINT_LOW("VendorExt: getparam: Extradata %s",exType);
284             break;
285         }
286         case OMX_QTIIndexParamCapabilitiesVTDriverVersion:
287         {
288             setStatus &= vExt.setParamInt32(ext, "number", 65536);
289             break;
290         }
291         case OMX_QTIIndexParamCapabilitiesMaxLTR:
292         {
293             setStatus &= vExt.setParamInt32(ext, "max-count", 3);
294             break;
295         }
296         case OMX_QTIIndexParamCapabilitiesMaxDownScaleRatio:
297         {
298             setStatus &= vExt.setParamInt32(ext, "max-downscale-factor", 8);
299             break;
300         }
301         case OMX_QTIIndexParamCapabilitiesRotationSupport:
302         {
303             setStatus &= vExt.setParamInt32(ext, "rotation",1);
304             break;
305         }
306         case OMX_QTIIndexParamCapabilitiesMaxTemporalLayers:
307         {
308             OMX_U32 nPLayerCountMax , nBLayerCountMax;
309             OMX_VIDEO_ANDROID_TEMPORALLAYERINGPATTERNTYPE SupportedPattern;
310             if (!dev_get_temporal_layer_caps(&nPLayerCountMax,
311                         &nBLayerCountMax, &SupportedPattern)) {
312                 DEBUG_PRINT_ERROR("Failed to get temporal layer capabilities");
313                 break;
314             }
315             setStatus &= vExt.setParamInt32(ext, "max-p-count",nPLayerCountMax);
316             setStatus &= vExt.setParamInt32(ext, "max-b-count",nBLayerCountMax);
317             break;
318         }
319         case OMX_QTIIndexParamColorSpaceConversion:
320         {
321             setStatus &= vExt.setParamInt32(ext, "enable", m_sParamColorSpaceConversion.bEnable);
322             break;
323         }
324         case QOMX_IndexParamVideoInitialQp:
325         {
326             setStatus &= vExt.setParamInt32(ext, "qp-i", m_sSessionQuantization.nQpI);
327             setStatus &= vExt.setParamInt32(ext, "qp-p", m_sSessionQuantization.nQpP);
328             setStatus &= vExt.setParamInt32(ext, "qp-b", m_sSessionQuantization.nQpB);
329             setStatus &= vExt.setParamInt32(ext, "qp-i-enable", (m_QPSet & 0x1));
330             setStatus &= vExt.setParamInt32(ext, "qp-p-enable", ((m_QPSet >> 0x1) & 0x1));
331             setStatus &= vExt.setParamInt32(ext, "qp-b-enable", ((m_QPSet >> 0x2) & 0x1));
332             break;
333         }
334         case OMX_QTIIndexConfigVideoBlurResolution:
335         {
336             break;
337         }
338         case OMX_QcomIndexParamVideoIPBQPRange:
339         {
340             setStatus &= vExt.setParamInt32(ext, "qp-i-min", m_sSessionQPRange.minIQP);
341             setStatus &= vExt.setParamInt32(ext, "qp-i-max", m_sSessionQPRange.maxIQP);
342             setStatus &= vExt.setParamInt32(ext, "qp-p-min", m_sSessionQPRange.minPQP);
343             setStatus &= vExt.setParamInt32(ext, "qp-p-max", m_sSessionQPRange.maxPQP);
344             setStatus &= vExt.setParamInt32(ext, "qp-b-min", m_sSessionQPRange.minBQP);
345             setStatus &= vExt.setParamInt32(ext, "qp-b-max", m_sSessionQPRange.maxBQP);
346             break;
347         }
348         default:
349         {
350             return OMX_ErrorNotImplemented;
351         }
352     }
353     return setStatus ? OMX_ErrorNone : OMX_ErrorUndefined;
354 }
355 
set_vendor_extension_config(OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE * ext)356 OMX_ERRORTYPE omx_video::set_vendor_extension_config(
357                 OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE *ext) {
358 
359     DEBUG_PRINT_LOW("set_vendor_extension_config");
360     if (ext->nIndex >= mVendorExtensionStore.size()) {
361         DEBUG_PRINT_ERROR("unrecognized vendor extension index (%u) max(%u)",
362                 ext->nIndex, mVendorExtensionStore.size());
363         return OMX_ErrorBadParameter;
364     }
365 
366     const VendorExtension& vExt = mVendorExtensionStore[ext->nIndex];
367     DEBUG_PRINT_LOW("VendorExt: setConfig: index=%u (%s)", ext->nIndex, vExt.name());
368 
369     OMX_ERRORTYPE err = OMX_ErrorNone;
370     err = vExt.isConfigValid(ext);
371     if (err != OMX_ErrorNone) {
372         return err;
373     }
374 
375     // mark this as set, regardless of set_config succeeding/failing.
376     // App will know by inconsistent values in output-format
377     vExt.set();
378 
379     bool valueSet = false;
380     switch ((OMX_U32)vExt.extensionIndex()) {
381         case OMX_IndexConfigCommonRotate:
382         {
383             OMX_CONFIG_ROTATIONTYPE rotationParam;
384             memcpy(&rotationParam, &m_sConfigFrameRotation, sizeof(OMX_CONFIG_ROTATIONTYPE));
385             valueSet |= vExt.readParamInt32(ext, "angle", &rotationParam.nRotation);
386             if (!valueSet) {
387                 break;
388             }
389 
390             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_IndexConfigCommonRotate : %d",
391                     rotationParam.nRotation);
392 
393             err = set_config(
394                     NULL, OMX_IndexConfigCommonRotate, &rotationParam);
395             if (err != OMX_ErrorNone) {
396                 DEBUG_PRINT_ERROR("set_config: OMX_IndexConfigCommonRotate failed !");
397             }
398             break;
399         }
400         case OMX_IndexConfigCommonMirror:
401         {
402             OMX_CONFIG_MIRRORTYPE mirrorParam;
403             memcpy(&mirrorParam, &m_sConfigFrameMirror, sizeof(OMX_CONFIG_MIRRORTYPE));
404             valueSet |= vExt.readParamInt32(ext, "flip", (OMX_S32*)&mirrorParam.eMirror);
405             if (!valueSet) {
406                 break;
407             }
408 
409             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_IndexConfigCommonMirror : %d",
410                              mirrorParam.eMirror);
411 
412             err = set_config(
413                     NULL, OMX_IndexConfigCommonMirror, &mirrorParam);
414             if (err != OMX_ErrorNone) {
415                 DEBUG_PRINT_ERROR("set_config: OMX_IndexConfigCommonMirror failed !");
416             }
417             break;
418         }
419         case QOMX_IndexConfigVideoIntraperiod:
420         {
421             QOMX_VIDEO_INTRAPERIODTYPE intraPeriodConfig;
422             memcpy(&intraPeriodConfig, &m_sIntraperiod, sizeof(QOMX_VIDEO_INTRAPERIODTYPE));
423 
424             if (vExt.isConfigKey(ext, "qti-ext-enc-avc-intra-period")) {
425                 valueSet |= vExt.readParamInt32(ext, "n-pframes", (OMX_S32 *)&(intraPeriodConfig.nPFrames));
426                 valueSet |= vExt.readParamInt32(ext, "n-idr-period", (OMX_S32 *)&(intraPeriodConfig.nIDRPeriod));
427 
428                 DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: AVC-intra-period : nP=%d, nIDR=%d",
429                     intraPeriodConfig.nPFrames, intraPeriodConfig.nIDRPeriod);
430             } else if (vExt.isConfigKey(ext, "qti-ext-enc-intra-period")) {
431                 valueSet |= vExt.readParamInt32(ext, "n-bframes", (OMX_S32 *)&(intraPeriodConfig.nBFrames));
432                 valueSet |= vExt.readParamInt32(ext, "n-pframes", (OMX_S32 *)&(intraPeriodConfig.nPFrames));
433                 valueSet |= vExt.readParamInt32(ext, "n-idr-period", (OMX_S32 *)&(intraPeriodConfig.nIDRPeriod));
434 
435                 DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: intra-period : nIDR=%d, nP=%d, nB=%d",
436                 intraPeriodConfig.nIDRPeriod, intraPeriodConfig.nPFrames, intraPeriodConfig.nBFrames);
437             }
438             if (!valueSet) {
439                 break;
440             }
441 
442             err = set_config(
443                     NULL, (OMX_INDEXTYPE)QOMX_IndexConfigVideoIntraperiod, &intraPeriodConfig);
444             if (err != OMX_ErrorNone) {
445                 DEBUG_PRINT_ERROR("set_config: QOMX_IndexConfigVideoIntraperiod failed !");
446             }
447             break;
448         }
449         case OMX_QcomIndexParamVideoSliceSpacing:
450         {
451             QOMX_VIDEO_PARAM_SLICE_SPACING_TYPE sliceSpacing;
452             memcpy(&sliceSpacing, &m_sSliceSpacing, sizeof(QOMX_VIDEO_PARAM_SLICE_SPACING_TYPE));
453 
454             if (vExt.isConfigKey(ext, "qti-ext-enc-error-correction")) {
455                 sliceSpacing.eSliceMode = QOMX_SLICEMODE_BYTE_COUNT;
456                 valueSet |= vExt.readParamInt32(ext,
457                     "resync-marker-spacing-bits", (OMX_S32 *)&(sliceSpacing.nSliceSize));
458                 sliceSpacing.nSliceSize = ALIGN(sliceSpacing.nSliceSize, 8) >> 3;
459             } else if (vExt.isConfigKey(ext, "qti-ext-enc-slice")) {
460                 sliceSpacing.eSliceMode = QOMX_SLICEMODE_MB_COUNT;
461                 valueSet |= vExt.readParamInt32(ext,
462                     "spacing", (OMX_S32 *)&(sliceSpacing.nSliceSize));
463             } else {
464               DEBUG_PRINT_ERROR("VENDOR-EXT: set_config: Slice Spacing : Incorrect Mode !");
465               break;
466             }
467 
468             if (!valueSet) {
469                 break;
470             }
471 
472             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: slice spacing : mode %d size %d",
473                     sliceSpacing.eSliceMode, sliceSpacing.nSliceSize);
474 
475             err = set_parameter(
476                     NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamVideoSliceSpacing, &sliceSpacing);
477             if (err != OMX_ErrorNone) {
478                 DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexParamVideoSliceSpacing failed !");
479             }
480             break;
481         }
482         case OMX_IndexParamVideoProfileLevelCurrent:
483         {
484             OMX_VIDEO_PARAM_PROFILELEVELTYPE profileParam;
485             memcpy(&profileParam, &m_sParamProfileLevel, sizeof(OMX_VIDEO_PARAM_PROFILELEVELTYPE));
486             valueSet |= vExt.readParamInt32(ext, "profile", (OMX_S32 *)&(profileParam.eProfile));
487             valueSet |= vExt.readParamInt32(ext, "level", (OMX_S32 *)&(profileParam.eLevel));
488             if (!valueSet) {
489                 break;
490             }
491 
492             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: custom-profile/level : profile=%u level=%u",
493                     (OMX_U32)profileParam.eProfile, (OMX_U32)profileParam.eLevel);
494 
495             err = set_parameter(
496                     NULL, OMX_IndexParamVideoProfileLevelCurrent, &profileParam);
497             if (err != OMX_ErrorNone) {
498                 DEBUG_PRINT_ERROR("set_config: OMX_IndexParamVideoProfileLevelCurrent failed !");
499             }
500 
501             break;
502         }
503         case OMX_QTIIndexParamEnableAVTimerTimestamps:
504         {
505             QOMX_ENABLETYPE avTimerEnableParam;
506             memcpy(&avTimerEnableParam, &m_sParamAVTimerTimestampMode, sizeof(QOMX_ENABLETYPE));
507             valueSet |= vExt.readParamInt32(ext, "enable", (OMX_S32 *)&(avTimerEnableParam.bEnable));
508             if (!valueSet) {
509                 break;
510             }
511 
512             DEBUG_PRINT_HIGH("VENDOR-EXT: AV-timer timestamp mode enable=%u", avTimerEnableParam.bEnable);
513 
514             err = set_parameter(
515                     NULL, (OMX_INDEXTYPE)OMX_QTIIndexParamEnableAVTimerTimestamps, &avTimerEnableParam);
516             if (err != OMX_ErrorNone) {
517                 DEBUG_PRINT_ERROR("set_param: OMX_QTIIndexParamEnableAVTimerTimestamps failed !");
518             }
519 
520             break;
521         }
522         case OMX_QcomIndexConfigQp:
523         {
524             OMX_QCOM_VIDEO_CONFIG_QP qpConfig;
525             memcpy(&qpConfig, &m_sConfigQP, sizeof(OMX_QCOM_VIDEO_CONFIG_QP));
526             valueSet |= vExt.readParamInt32(ext, "value", (OMX_S32 *)&(qpConfig.nQP));
527             if (!valueSet) {
528                 break;
529             }
530 
531             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: nQP =%u", qpConfig.nQP);
532 
533             err = set_config(
534                     NULL, (OMX_INDEXTYPE)OMX_QcomIndexConfigQp, &qpConfig);
535             if (err != OMX_ErrorNone) {
536                 DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexConfigQp failed !");
537             }
538 
539             break;
540         }
541         case OMX_QcomIndexParamVideoDownScalar:
542         {
543             QOMX_INDEXDOWNSCALAR downScalarParam;
544             memcpy(&downScalarParam, &m_sParamDownScalar, sizeof(QOMX_INDEXDOWNSCALAR));
545             downScalarParam.bEnable = OMX_TRUE;
546             valueSet |= vExt.readParamInt32(ext, "output-width", (OMX_S32 *)&(downScalarParam.nOutputWidth));
547             valueSet |= vExt.readParamInt32(ext, "output-height", (OMX_S32 *)&(downScalarParam.nOutputHeight));
548             if(!valueSet) {
549                 break;
550             }
551 
552             DEBUG_PRINT_HIGH("VENDOR-EXT: Downscalar Enable = %u Output Width = %u Output Height = %u",
553                              downScalarParam.bEnable, downScalarParam.nOutputWidth, downScalarParam.nOutputHeight);
554 
555             err = set_parameter(NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamVideoDownScalar, &downScalarParam);
556             if (err != OMX_ErrorNone) {
557                 DEBUG_PRINT_ERROR("set_param: OMX_QcomIndexParamVideoDownScalar failed !");
558             }
559             break;
560         }
561         case OMX_QcomIndexParamVencControlInputQueue:
562         {
563             QOMX_ENABLETYPE controlInputQueueParam;
564             memcpy(&controlInputQueueParam, &m_sParamControlInputQueue, sizeof(QOMX_ENABLETYPE));
565             valueSet |= vExt.readParamInt32(ext, "enable", (OMX_S32 *)&(controlInputQueueParam.bEnable));
566             if (!valueSet) {
567                 break;
568             }
569 
570             DEBUG_PRINT_HIGH("VENDOR-EXT: set_param: control input queue enable=%u", controlInputQueueParam.bEnable);
571 
572             err = set_parameter(
573                     NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamVencControlInputQueue, &controlInputQueueParam);
574             if (err != OMX_ErrorNone) {
575                 DEBUG_PRINT_ERROR("set_param: OMX_QcomIndexParamVencControlInputQueue failed !");
576             }
577 
578             break;
579         }
580         case OMX_IndexConfigTimePosition:
581         {
582             OMX_TIME_CONFIG_TIMESTAMPTYPE triggerTimeStamp;
583             memcpy(&triggerTimeStamp, &m_sConfigInputTrigTS, sizeof(OMX_TIME_CONFIG_TIMESTAMPTYPE));
584             valueSet |= vExt.readParamInt64(ext, "timestamp", (OMX_S64 *)&(triggerTimeStamp.nTimestamp));
585             if (!valueSet) {
586                 break;
587             }
588 
589             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: trigger timestamp =%lld", triggerTimeStamp.nTimestamp);
590 
591             err = set_config(
592                     NULL, (OMX_INDEXTYPE)OMX_IndexConfigTimePosition, &triggerTimeStamp);
593             if (err != OMX_ErrorNone) {
594                 DEBUG_PRINT_ERROR("set_config: OMX_IndexConfigTimePosition failed !");
595             }
596 
597             break;
598         }
599         case OMX_QTIIndexParamLowLatencyMode:
600         {
601             QOMX_EXTNINDEX_VIDEO_LOW_LATENCY_MODE lowLatency;
602             memcpy(&lowLatency, &m_sParamLowLatency, sizeof(QOMX_EXTNINDEX_VIDEO_LOW_LATENCY_MODE));
603             valueSet |= vExt.readParamInt32(ext, "enable", (OMX_S32 *)&(lowLatency.bEnableLowLatencyMode));
604             if (!valueSet) {
605                 break;
606             }
607 
608             DEBUG_PRINT_HIGH("VENDOR-EXT: set_param: low latency mode =%u", lowLatency.bEnableLowLatencyMode);
609 
610             err = set_parameter(
611                     NULL, (OMX_INDEXTYPE)OMX_QTIIndexParamLowLatencyMode, &lowLatency);
612             if (err != OMX_ErrorNone) {
613                 DEBUG_PRINT_ERROR("set_param: OMX_QTIIndexParamLowLatencyMode failed !");
614             }
615 
616             break;
617         }
618         case OMX_QcomIndexConfigBaseLayerId:
619         {
620             OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID baselayerPID;
621             memcpy(&baselayerPID, &m_sBaseLayerID, sizeof(OMX_SKYPE_VIDEO_CONFIG_BASELAYERPID));
622             valueSet |= vExt.readParamInt32(ext, "value", (OMX_S32 *)&(baselayerPID.nPID));
623             if (!valueSet) {
624                 break;
625             }
626 
627             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: base layer pid =%u", baselayerPID.nPID);
628 
629             err = set_config(
630                     NULL, (OMX_INDEXTYPE)OMX_QcomIndexConfigBaseLayerId, &baselayerPID);
631             if (err != OMX_ErrorNone) {
632                 DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexConfigBaseLayerId failed !");
633             }
634 
635             break;
636         }
637         case OMX_QcomIndexParamVideoLTRCount:
638         {
639            QOMX_VIDEO_PARAM_LTRCOUNT_TYPE ltrCount;
640            memcpy(&ltrCount, &m_sParamLTRCount, sizeof(QOMX_VIDEO_PARAM_LTRCOUNT_TYPE));
641            valueSet |= vExt.readParamInt32(ext, "num-ltr-frames", (OMX_S32 *)&(ltrCount.nCount));
642            if (!valueSet) {
643                 break;
644             }
645 
646             DEBUG_PRINT_HIGH("VENDOR-EXT: set_parameter: ltr count  =%u", ltrCount.nCount);
647 
648             err = set_parameter(
649                     NULL, (OMX_INDEXTYPE)QOMX_IndexParamVideoLTRCount, &ltrCount);
650             if (err != OMX_ErrorNone) {
651                 DEBUG_PRINT_ERROR("set_parameter: OMX_QcomIndexParamVideoLTRCount failed !");
652             }
653 
654             break;
655         }
656         case OMX_QcomIndexConfigVideoLTRUse:
657         {
658            QOMX_VIDEO_CONFIG_LTRUSE_TYPE ltrUse;
659            memcpy(&ltrUse, &m_sConfigLTRUse, sizeof(QOMX_VIDEO_CONFIG_LTRUSE_TYPE));
660            valueSet |= vExt.readParamInt32(ext, "use-frame", (OMX_S32 *)&(ltrUse.nID));
661            if (!valueSet) {
662                 break;
663             }
664 
665             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: ltr use  =%u", ltrUse.nID);
666 
667             err = set_config(
668                     NULL, (OMX_INDEXTYPE)QOMX_IndexConfigVideoLTRUse, &ltrUse);
669             if (err != OMX_ErrorNone) {
670                 DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexConfigVideoLTRUse failed !");
671             }
672 
673             break;
674         }
675         case OMX_QcomIndexConfigVideoLTRMark:
676         {
677            QOMX_VIDEO_CONFIG_LTRMARK_TYPE ltrMark;
678            memcpy(&ltrMark, &m_sConfigLTRMark, sizeof(QOMX_VIDEO_CONFIG_LTRMARK_TYPE));
679            valueSet |= vExt.readParamInt32(ext, "mark-frame", (OMX_S32 *)&(ltrMark.nID));
680            if (!valueSet) {
681                 break;
682             }
683 
684             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: ltr mark  =%u", ltrMark.nID);
685 
686             err = set_config(
687                     NULL, (OMX_INDEXTYPE)QOMX_IndexConfigVideoLTRMark, &ltrMark);
688             if (err != OMX_ErrorNone) {
689                 DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexConfigVideoLTRMark failed !");
690             }
691 
692             break;
693         }
694         case OMX_IndexConfigVideoFramerate:
695         {
696             OMX_CONFIG_FRAMERATETYPE rateParam;
697             memcpy(&rateParam, &m_sConfigFramerate, sizeof(OMX_CONFIG_FRAMERATETYPE));
698             valueSet |= vExt.readParamInt32(ext, "frame-rate", (OMX_S32 *)&rateParam.xEncodeFramerate);
699             if (!valueSet) {
700                 break;
701             }
702             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_IndexConfigVideoFramerate : %d",
703                     rateParam.xEncodeFramerate);
704 
705             err = set_config(
706                     NULL, OMX_IndexConfigVideoFramerate, &rateParam);
707             if (err != OMX_ErrorNone) {
708                 DEBUG_PRINT_ERROR("set_config: OMX_IndexConfigVideoFramerate failed !");
709             }
710             break;
711         }
712         case  OMX_QcomIndexParamIndexExtraDataType:
713         {
714             QOMX_INDEXEXTRADATATYPE extraDataParam;
715             char exType[OMX_MAX_STRINGVALUE_SIZE];
716             OMX_INIT_STRUCT(&extraDataParam, QOMX_INDEXEXTRADATATYPE);
717             valueSet |= vExt.readParamString(ext, "types", exType);
718             if (!valueSet) {
719                 break;
720             }
721             char *rest = exType;
722             char *token = strtok_r(exType, "|", &rest);
723             do {
724                 extraDataParam.bEnabled = OMX_TRUE;
725                 extraDataParam.nIndex = (OMX_INDEXTYPE)getIndexForExtradataType(token);
726                 if (extraDataParam.nIndex < 0) {
727                     DEBUG_PRINT_HIGH(" extradata %s not supported ",token);
728                     continue;
729                 }
730                 if (extraDataParam.nIndex == (OMX_INDEXTYPE)OMX_ExtraDataVideoLTRInfo ||
731                     extraDataParam.nIndex == (OMX_INDEXTYPE)OMX_ExtraDataVideoEncoderMBInfo) {
732                     extraDataParam.nPortIndex = (OMX_U32)PORT_INDEX_OUT;
733                 }
734                 DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: extradata: enable for index = %d",
735                                   extraDataParam.nIndex);
736                 err = set_parameter(
737                        NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamIndexExtraDataType, &extraDataParam);
738                 if (err != OMX_ErrorNone) {
739                     DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexParamIndexExtraDataType failed !");
740                 }
741             } while ((token = strtok_r(NULL, "|", &rest)));
742             break;
743         }
744         case OMX_QTIIndexParamColorSpaceConversion:
745         {
746             QOMX_ENABLETYPE colorspaceConversionParam;
747             memcpy(&colorspaceConversionParam, &m_sParamColorSpaceConversion, sizeof(QOMX_ENABLETYPE));
748             valueSet |= vExt.readParamInt32(ext, "enable", (OMX_S32 *)&(colorspaceConversionParam.bEnable));
749             if (!valueSet) {
750                 break;
751             }
752 
753             DEBUG_PRINT_HIGH("VENDOR-EXT: set_param: color space conversion enable=%u", colorspaceConversionParam.bEnable);
754 
755             err = set_parameter(
756                    NULL, (OMX_INDEXTYPE)OMX_QTIIndexParamColorSpaceConversion, &colorspaceConversionParam);
757             if (err != OMX_ErrorNone) {
758                 DEBUG_PRINT_ERROR("set_param: OMX_QTIIndexParamColorSpaceConversion failed !");
759             }
760 
761             break;
762         }
763         case OMX_QTIIndexParamCapabilitiesVTDriverVersion:
764         case OMX_QTIIndexParamCapabilitiesMaxLTR:
765         case OMX_QTIIndexParamCapabilitiesMaxDownScaleRatio:
766         case OMX_QTIIndexParamCapabilitiesRotationSupport:
767         case OMX_QTIIndexParamCapabilitiesMaxTemporalLayers:
768         {
769             break;
770         }
771         case QOMX_IndexParamVideoInitialQp:
772         {
773             QOMX_EXTNINDEX_VIDEO_INITIALQP initQP;
774             OMX_INIT_STRUCT(&initQP, QOMX_EXTNINDEX_VIDEO_INITIALQP);
775             initQP.nPortIndex = (OMX_U32)PORT_INDEX_OUT;
776             OMX_S32 enableIQp = (m_QPSet & 0x1);
777             OMX_S32 enablePQp = ((m_QPSet >> 0x1) & 0x1);
778             OMX_S32 enableBQp = ((m_QPSet >> 0x2) & 0x1);
779             initQP.nQpI = m_sSessionQuantization.nQpI;
780             initQP.nQpP = m_sSessionQuantization.nQpP;
781             initQP.nQpB = m_sSessionQuantization.nQpB;
782             initQP.bEnableInitQp = m_QPSet;
783             valueSet |= vExt.readParamInt32(ext, "qp-i", (OMX_S32 *)&(initQP.nQpI));
784             valueSet |= vExt.readParamInt32(ext, "qp-b", (OMX_S32 *)&(initQP.nQpB));
785             valueSet |= vExt.readParamInt32(ext, "qp-p", (OMX_S32 *)&(initQP.nQpP));
786             valueSet |= vExt.readParamInt32(ext, "qp-i-enable", (OMX_S32 *)&enableIQp);
787             valueSet |= vExt.readParamInt32(ext, "qp-p-enable", (OMX_S32 *)&enablePQp);
788             valueSet |= vExt.readParamInt32(ext, "qp-b-enable", (OMX_S32 *)&enableBQp);
789             initQP.bEnableInitQp = (((enableIQp == 0x1) << 0x0 ) | ((enablePQp == 0x1) << 0x1 ) | ((enableBQp == 0x1) << 0x2 ));
790             if (!valueSet) {
791                 break;
792             }
793 
794             DEBUG_PRINT_HIGH("VENDOR-EXT: set_param: QOMX_IndexParamVideoInitialQp I/B/P value: %d %d %d",
795                 initQP.nQpI,initQP.nQpB,initQP.nQpP);
796 
797             err = set_parameter(
798                     NULL, (OMX_INDEXTYPE)QOMX_IndexParamVideoInitialQp, &initQP);
799             if (err != OMX_ErrorNone) {
800                 DEBUG_PRINT_ERROR("set_param: QOMX_IndexParamVideoInitialQp failed !");
801             }
802             break;
803         }
804         case OMX_QTIIndexConfigVideoBlurResolution:
805         {
806             OMX_QTI_VIDEO_CONFIG_BLURINFO blurInfo;
807             memcpy(&blurInfo, &m_blurInfo, sizeof(OMX_QTI_VIDEO_CONFIG_BLURINFO));
808             OMX_S32 targetStrength = 0;
809             valueSet |= vExt.readParamInt32(ext, "strength", (OMX_S32 *)&(targetStrength));
810             if (!valueSet) {
811                 break;
812             }
813             if (targetStrength <= BLUR_STRENGTH_NONE && targetStrength > BLUR_STRENGTH_MAX240) {
814                 blurInfo.eTargetResol = BLUR_RESOL_DISABLED;
815             }
816             else if (targetStrength > BLUR_STRENGTH_NONE && targetStrength <= BLUR_STRENGTH_MAX1080) {
817                 blurInfo.eTargetResol = BLUR_RESOL_1080;
818             }
819             else if (targetStrength >= BLUR_STRENGTH_MAX1080 && targetStrength <= BLUR_STRENGTH_MAX720) {
820                 blurInfo.eTargetResol = BLUR_RESOL_720;
821             }
822             else if (targetStrength >= BLUR_STRENGTH_MAX720 && targetStrength <= BLUR_STRENGTH_MAX480 ) {
823                 blurInfo.eTargetResol = BLUR_RESOL_480;
824             }
825             else if (targetStrength >= BLUR_STRENGTH_MAX480 && targetStrength <= BLUR_STRENGTH_MAX240) {
826                 blurInfo.eTargetResol = BLUR_RESOL_240;
827             }
828 
829             DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_QTIIndexConfigVideoBlurResolution : %d",
830                     targetStrength);
831 
832             err = set_config(
833                     NULL, (OMX_INDEXTYPE)OMX_QTIIndexConfigVideoBlurResolution, &blurInfo);
834             if (err != OMX_ErrorNone) {
835                 DEBUG_PRINT_ERROR("set_config: OMX_QTIIndexConfigVideoBlurResolution failed !");
836             }
837             break;
838         }
839         case OMX_QcomIndexParamVideoIPBQPRange:
840         {
841             OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE qpRange;
842             memcpy(&qpRange, &m_sSessionQPRange, sizeof(OMX_QCOM_VIDEO_PARAM_IPB_QPRANGETYPE));
843             valueSet |= vExt.readParamInt32(ext, "qp-i-min", (OMX_S32 *)&(qpRange.minIQP));
844             valueSet |= vExt.readParamInt32(ext, "qp-i-max", (OMX_S32 *)&(qpRange.maxIQP));
845             valueSet |= vExt.readParamInt32(ext, "qp-p-min", (OMX_S32 *)&(qpRange.minPQP));
846             valueSet |= vExt.readParamInt32(ext, "qp-p-max", (OMX_S32 *)&(qpRange.maxPQP));
847             valueSet |= vExt.readParamInt32(ext, "qp-b-min", (OMX_S32 *)&(qpRange.minBQP));
848             valueSet |= vExt.readParamInt32(ext, "qp-b-max", (OMX_S32 *)&(qpRange.maxBQP));
849             if (!valueSet) {
850                 break;
851             }
852 
853             DEBUG_PRINT_HIGH("VENDOR-EXT: set_param: OMX_QcomIndexParamVideoIPBQPRange for min/max value for I/P/B: %d-%d / %d-%d / %d-%d"
854                 ,qpRange.minIQP,qpRange.maxIQP,qpRange.minPQP,qpRange.maxPQP,qpRange.minBQP,qpRange.maxBQP);
855 
856             err = set_parameter(
857                     NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamVideoIPBQPRange, &qpRange);
858             if (err != OMX_ErrorNone) {
859                 DEBUG_PRINT_ERROR("set_param: OMX_QcomIndexParamVideoIPBQPRange failed !");
860             }
861             break;
862         }
863         default:
864         {
865             return OMX_ErrorNotImplemented;
866         }
867     }
868     return err;
869 }
870