summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 820edc5)
raw | patch | inline | side by side (parent: 820edc5)
author | Buddy Liong <a0270631@ti.com> | |
Thu, 30 Jun 2016 16:51:36 +0000 (11:51 -0500) | ||
committer | Buddy Liong <a0270631@ti.com> | |
Tue, 5 Jul 2016 20:59:10 +0000 (15:59 -0500) |
Prior to this patch, when codec_create fails and return NULL VIDDEC3_Handle.
DCE will still caling dce_register_codec with NULL data which is not
necessary. When dce_register_codec return < 0, it continue processing for
low latency mode, which is also not necessary.
This patch check on VIDDEC3_Handle to make sure it is not NULL before
calling dce_register_codec. It also moves the processing for low latency
mode to be executed only when dce_register_codec is successful.
Change-Id: I4b8fba03272c3d7c825a0bdbe813e74e04aaf555
Signed-off-by: Buddy Liong <a0270631@ti.com>
DCE will still caling dce_register_codec with NULL data which is not
necessary. When dce_register_codec return < 0, it continue processing for
low latency mode, which is also not necessary.
This patch check on VIDDEC3_Handle to make sure it is not NULL before
calling dce_register_codec. It also moves the processing for low latency
mode to be executed only when dce_register_codec is successful.
Change-Id: I4b8fba03272c3d7c825a0bdbe813e74e04aaf555
Signed-off-by: Buddy Liong <a0270631@ti.com>
src/ti/framework/dce/dce.c | patch | blob | history |
index d9876a840846f0d222f6f5c8edf25e756e7be08f..f0e1d77b70e2ea3aaa1f5e408d53b87a6e4ce042 100644 (file)
codec_handle = (void *)codec_fxns[codec_id].create(engine, codec_name, static_params);
ivahd_release();
- mm_serv_id = MmServiceMgr_getId();
-
- ret = dce_register_codec(codec_id, mm_serv_id, (Uint32) codec_handle);
- if( ret < 0 ) {
- codec_fxns[codec_id].delete((void *)codec_handle);
- codec_handle = NULL;
- }
+ if( codec_handle ) {
+ mm_serv_id = MmServiceMgr_getId();
- if ( codec_id == OMAP_DCE_VIDDEC3 ) {
- DEBUG("codec_create for VIDDEC3 codec_handle 0x%x mm_serv_id 0x%x", codec_handle, mm_serv_id);
- if ( ((VIDDEC3_Params*)static_params)->outputDataMode == IVIDEO_NUMROWS ) {
- c = get_client_instance((Uint32) codec_handle);
- int i;
- for (i = 0; i < DIM(c->decode_codec); i++ ) {
- if (c->decode_codec[i] == codec_handle) {
- c->decode_callback[i].row_mode = 1;
- pthread_mutex_init(&(c->decode_callback[i].callback_mutex), NULL);
- pthread_cond_init(&(c->decode_callback[i].synch_callback), NULL);
- DEBUG("codec_create client 0x%x c->decode_callback[%d].callback_mutex 0x%x c->decode_callback[%d].row_mode %d",
- c, i, c->decode_callback[i].callback_mutex, i, c->decode_callback[i].row_mode);
+ ret = dce_register_codec(codec_id, mm_serv_id, (Uint32) codec_handle);
+ if( ret < 0 ) {
+ codec_fxns[codec_id].delete((void *)codec_handle);
+ codec_handle = NULL;
+ } else {
+ if( codec_id == OMAP_DCE_VIDDEC3 ) {
+ DEBUG("codec_create for VIDDEC3 codec_handle 0x%x mm_serv_id 0x%x", codec_handle, mm_serv_id);
+ if( ((VIDDEC3_Params*)static_params)->outputDataMode == IVIDEO_NUMROWS ) {
+ c = get_client_instance((Uint32) codec_handle);
+ int i;
+ for( i = 0; i < DIM(c->decode_codec); i++ ) {
+ if( c->decode_codec[i] == codec_handle ) {
+ c->decode_callback[i].row_mode = 1;
+ pthread_mutex_init(&(c->decode_callback[i].callback_mutex), NULL);
+ pthread_cond_init(&(c->decode_callback[i].synch_callback), NULL);
+ DEBUG("codec_create client 0x%x c->decode_callback[%d].callback_mutex 0x%x c->decode_callback[%d].row_mode %d",
+ c, i, c->decode_callback[i].callback_mutex, i, c->decode_callback[i].row_mode);
+ }
+ }
}
- }
- }
- } else if ( codec_id == OMAP_DCE_VIDENC2 ) {
- DEBUG("codec_create for VIDENC2 codec_handle 0x%x mm_serv_id 0x%x", codec_handle, mm_serv_id);
- if ( ((VIDENC2_Params*)static_params)->inputDataMode == IVIDEO_NUMROWS ) {
- c = get_client_instance((Uint32) codec_handle);
- int i;
- for (i = 0; i < DIM(c->encode_codec); i++ ) {
- if (c->encode_codec[i] == codec_handle) {
- c->encode_callback[i].row_mode = 1;
- pthread_mutex_init(&(c->encode_callback[i].callback_mutex), NULL);
- pthread_cond_init(&(c->encode_callback[i].synch_callback), NULL);
- DEBUG("codec_create client 0x%x c->encode_callback[%d].callback_mutex 0x%x c->encode_callback[%d].row_mode %d",
- c, i, c->encode_callback[i].callback_mutex, i, c->encode_callback[i].row_mode);
+ } else if( codec_id == OMAP_DCE_VIDENC2 ) {
+ DEBUG("codec_create for VIDENC2 codec_handle 0x%x mm_serv_id 0x%x", codec_handle, mm_serv_id);
+ if( ((VIDENC2_Params*)static_params)->inputDataMode == IVIDEO_NUMROWS ) {
+ c = get_client_instance((Uint32) codec_handle);
+ int i;
+ for( i = 0; i < DIM(c->encode_codec); i++ ) {
+ if( c->encode_codec[i] == codec_handle ) {
+ c->encode_callback[i].row_mode = 1;
+ pthread_mutex_init(&(c->encode_callback[i].callback_mutex), NULL);
+ pthread_cond_init(&(c->encode_callback[i].synch_callback), NULL);
+ DEBUG("codec_create client 0x%x c->encode_callback[%d].callback_mutex 0x%x c->encode_callback[%d].row_mode %d",
+ c, i, c->encode_callback[i].callback_mutex, i, c->encode_callback[i].row_mode);
+ }
+ }
}
}
}
}
-
DEBUG("<< codec_handle=%08x on engine %08x", codec_handle, engine);
dce_clean(static_params);