{"action":"closed","issue":{"url":"https://api.github.com/repos/raspberrypi/firmware/issues/145","labels_url":"https://api.github.com/repos/raspberrypi/firmware/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/raspberrypi/firmware/issues/145/comments","events_url":"https://api.github.com/repos/raspberrypi/firmware/issues/145/events","html_url":"https://github.com/raspberrypi/firmware/issues/145","id":10698000,"number":145,"title":"Tunneling","user":{"login":"devalexqt","id":865007,"avatar_url":"https://avatars.githubusercontent.com/u/865007?v=3","gravatar_id":"","url":"https://api.github.com/users/devalexqt","html_url":"https://github.com/devalexqt","followers_url":"https://api.github.com/users/devalexqt/followers","following_url":"https://api.github.com/users/devalexqt/following{/other_user}","gists_url":"https://api.github.com/users/devalexqt/gists{/gist_id}","starred_url":"https://api.github.com/users/devalexqt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devalexqt/subscriptions","organizations_url":"https://api.github.com/users/devalexqt/orgs","repos_url":"https://api.github.com/users/devalexqt/repos","events_url":"https://api.github.com/users/devalexqt/events{/privacy}","received_events_url":"https://api.github.com/users/devalexqt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2013-02-06T16:15:55Z","updated_at":"2015-06-22T12:25:50Z","closed_at":"2015-06-22T12:25:50Z","body":"Its possible to use tunnel  with passed data from video_decoder to video_encoder ?\r\nI always get error:\r\n\r\n-5: the data format was not acceptable to the sink\r\nNeed special configuration?\r\n\r\nThis my port setup configuration:\r\n\r\nOMX_ERRORTYPE r;\r\n   OMX_VIDEO_PARAM_PORTFORMATTYPE in_dec_format,out_enc_format,out_dec_Format;\r\n   OMX_PARAM_PORTDEFINITIONTYPE in_enc_format;\r\n   COMPONENT_T *video_decode = NULL,*video_encode=NULL,*video_resize=NULL, *video_render = NULL;\r\n   COMPONENT_T *list[5];\r\n   TUNNEL_T tunnel[4];\r\n   ILCLIENT_T *client;\r\n   int status = 0;\r\n\r\n   memset(list, 0, sizeof(list));\r\n   memset(tunnel, 0, sizeof(tunnel));\r\n\r\n   if((client = ilclient_init()) == NULL){printf(\"=>Can't init ilclient_init()!\\n\");exit(-1);}\r\n   if(OMX_Init() != OMX_ErrorNone){ilclient_destroy(client);printf(\"=>Can't init omx!\\n\");exit(-1);}\r\n\r\n   // create video_decode\r\n   if(ilclient_create_component(client, &video_decode, \"video_decode\", ILCLIENT_DISABLE_ALL_PORTS | ILCLIENT_ENABLE_INPUT_BUFFERS) != 0)\r\n      status = -14;\r\n   list[0] = video_decode;\r\n\r\n   // create resize\r\n   if(ilclient_create_component(client, &video_resize, \"resize\",ILCLIENT_DISABLE_ALL_PORTS) != 0){status = -14; printf(\"=> ilclient_create_component() for video_resize failed!!\\n\");exit(1);}\r\n   list[1] = video_resize;\r\n\r\n   // create video_encode\r\n   if(ilclient_create_component(client, &video_encode, \"video_encode\",ILCLIENT_DISABLE_ALL_PORTS | ILCLIENT_ENABLE_OUTPUT_BUFFERS) != 0){status = -14; printf(\"=> ilclient_create_component() for video_encode failed!!\\n\");exit(1);}\r\n   list[2] = video_encode;\r\n\r\n   // create video_render\r\n   if(status == 0 && ilclient_create_component(client, &video_render, \"video_render\", ILCLIENT_DISABLE_ALL_PORTS) != 0)\r\n      status = -14;\r\n   list[3] = video_render;\r\n\r\n\r\n//   set_tunnel(tunnel, video_decode, 131, video_render, 90);\r\n   set_tunnel(tunnel, video_decode, 131, video_encode, 200);\r\n\r\n\r\n   if(status == 0){\r\n      ilclient_change_component_state(video_decode, OMX_StateIdle);\r\n     ilclient_change_component_state(video_encode, OMX_StateIdle);\r\n                   }//if status\r\n\r\n   //input dec format\r\n   memset(&in_dec_format, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));\r\n   in_dec_format.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);\r\n   in_dec_format.nVersion.nVersion = OMX_VERSION;\r\n   in_dec_format.nPortIndex = 130;\r\n   in_dec_format.eCompressionFormat = OMX_VIDEO_CodingAVC;\r\n   r = OMX_SetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexParamVideoPortFormat, &in_dec_format);\r\n   if ( r!= OMX_ErrorNone){printf(\"%s:%d: OMX_SetParameter() for video_decode port 130 failed with 0x%08x!\\n\",__FUNCTION__, __LINE__, r);exit(-1);}\r\n\r\n\r\n   //output dec format\r\n   memset(&out_dec_Format, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));\r\n   out_dec_Format.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);\r\n   out_dec_Format.nVersion.nVersion = OMX_VERSION;\r\n   out_dec_Format.nPortIndex = 131;\r\n  // out_dec_Format.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar;\r\n  //if (OMX_GetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexParamPortDefinition, &out_dec_Format) != OMX_ErrorNone) {printf(\"%s:%d: OMX_GetParameter() for video_encode port 131 failed!\\n\", __FUNCTION__, __LINE__);status=-1;exit(-1);}\r\n\r\n   if(OMX_SetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexParamVideoPortFormat, &out_dec_Format)!=OMX_ErrorNone){printf(\"=> Failed set  output port formats of buffers for port (video_decode) : 131 \\n\");status=-1;exit(-1);}\r\n\r\n//   //input video_encode\r\n   memset(&in_enc_format, 0, sizeof(OMX_PARAM_PORTDEFINITIONTYPE));\r\n   in_enc_format.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);\r\n   in_enc_format.nVersion.nVersion = OMX_VERSION;\r\n   in_enc_format.nPortIndex = 200;\r\n   if (OMX_GetParameter(ILC_GET_HANDLE(video_encode), OMX_IndexParamPortDefinition,&in_enc_format) != OMX_ErrorNone) {printf(\"%s:%d: OMX_GetParameter() for video_encode port 200 failed!\\n\", __FUNCTION__, __LINE__);exit(1);}\r\n   // Port 200: in 1/1 115200 16 enabled,not pop.,not cont. 320x240 320x240 @1966080 20\r\n   in_enc_format.format.video.nFrameWidth = WIDTH;\r\n   in_enc_format.format.video.nFrameHeight = HEIGHT;\r\n   in_enc_format.format.video.xFramerate = 30 << 16;\r\n   in_enc_format.format.video.nSliceHeight = in_enc_format.format.video.nFrameHeight;\r\n   in_enc_format.format.video.nStride = in_enc_format.format.video.nFrameWidth;\r\n   in_enc_format.format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar;\r\n   if (( r = OMX_SetParameter(ILC_GET_HANDLE(video_encode),OMX_IndexParamPortDefinition, &in_enc_format)) != OMX_ErrorNone){printf(\"%s:%d: OMX_SetParameter() for video_encode port 200 failed with %x!\\n\", __FUNCTION__, __LINE__, r);exit(1);}\r\n\r\n   //output video_encode\r\n   memset(&out_enc_format, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));\r\n   out_enc_format.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);\r\n   out_enc_format.nVersion.nVersion = OMX_VERSION;\r\n   out_enc_format.nPortIndex = 201;\r\n   out_enc_format.eCompressionFormat = OMX_VIDEO_CodingAVC;\r\n   if ((r = OMX_SetParameter(ILC_GET_HANDLE(video_encode),OMX_IndexParamVideoPortFormat, &out_enc_format)) != OMX_ErrorNone){printf(\"%s:%d: OMX_SetParameter() for video_encode port 201 failed with %x!\\n\",__FUNCTION__, __LINE__, r);exit(1);}\r\n\r\n\r\n   if(status != 0 &&\r\n      ilclient_enable_port_buffers(video_decode, 130, NULL, NULL, NULL) != 0 &&\r\n      ilclient_enable_port_buffers(video_encode, 201, NULL, NULL, NULL) != 0){printf(\"Failed ilclient_enable_port_buffers\\n\");exit(-1);}\r\n......\r\n......"}}