diff mbox

How to disable the signal handler in dsplink

Message ID 200909150819.32672.caglarakyuz@gmail.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Yusuf Caglar AKYUZ Sept. 15, 2009, 5:19 a.m. UTC
On Tuesday 15 September 2009 04:36:18 yang shaobo wrote:
> Dear caglar :
> Thanks a lot for your patch !
> Now the new dsplink works perfectly with my gstreamer.
>
> According FAQ on DSPLink wiki, the other thing that should be done may
> be adding the dsplink cleanup functions to gstreamer core .
> I will try this .
>

I use something like this.

Regards,
Caglar


> 2009/9/14, Caglar Akyuz <caglarakyuz@gmail.com>:
> > On Monday 14 September 2009 13:09:28 yang shaobo wrote:
> >> Dear Uppal :
> >> Thanks for your quick reply.
> >> I modified the $(DSPLINK)/config/all/CFG_Linux.c.
> >> I changed the Handle signals for cleanup from "TRUE" to "FALSE".
> >> And , changed NUMSIGNALS from "8u" to "0u".
> >> Then , I recompiled the dsplink , cmem ,dmai , codec_combos, also
> >> gstreamer ( I use gstreamer as my application ).
> >> However , the gstreamer still can not receive signals.
> >> It seemed that nothing is changed.
> >> So, I am confused .
> >
> > I guess you need to change your codec engine configuration. AFAIK,
> >  $(DSPLINK)/config/all/CFG_Linux.c file is not used while using codec
> > engine,
> > instead CE provides its own configuration. It was far easier for me to
> > modify
> > dsplink code for this. Please see the attached patch.
> >
> > I hope this helps,
> > Caglar
> >
> > ---
> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
> >/api/Linux/drv_api.c	2008-10-24 22:58:03.000000000 +0300
> > +++
> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
> >/api/Linux/drv_api_mine.c	2009-07-06 15:45:50.000000000 +0300
> > @@ -477,7 +477,8 @@
> >          status = DSP_EPOINTER ;
> >          SET_FAILURE_REASON ;
> >      }
> > -
> > +
> > +    DSPLINK_atExitHandler();
> >      TRC_1LEAVE ("DRV_Finalize", status) ;
> >
> >      return status ;
> > @@ -1606,7 +1607,7 @@
> >
> >      TRC_1ENTER ("DRV_installCleanupRoutines", linkCfgPtr) ;
> >
> > -    if (linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) {
> > +    if (0 && linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE)
> > { sigemptyset (&block_mask) ;
> >          sigfillset( &block_mask) ;
> >          sigInstaller.sa_flags   = (SA_RESTART) ;
> > @@ -1619,7 +1620,6 @@
> >                         NULL) ;
> >          }
> >      }
> > -    atexit (&DSPLINK_atExitHandler) ;
> >
> >      TRC_0LEAVE ("DRV_installCleanupRoutines") ;
> >  }

Comments

yang shaobo Sept. 18, 2009, 1:42 a.m. UTC | #1
Thanks again for your patch !
I will try it as soon as possible .

Best regards.


2009/9/15, Caglar Akyuz <caglarakyuz@gmail.com>:
> On Tuesday 15 September 2009 04:36:18 yang shaobo wrote:
>> Dear caglar :
>> Thanks a lot for your patch !
>> Now the new dsplink works perfectly with my gstreamer.
>>
>> According FAQ on DSPLink wiki, the other thing that should be done may
>> be adding the dsplink cleanup functions to gstreamer core .
>> I will try this .
>>
>
> I use something like this.
>
> Regards,
> Caglar
>
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1_mine.c	2009-07-06
> 16:13:23.000000000 +0300
> @@ -1059,6 +1059,9 @@
>              if (!gst_tiauddec1_exit_audio(auddec1)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            if (gst_tiauddec1_codec_stop(auddec1) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          case GST_STATE_CHANGE_READY_TO_PAUSED:
> @@ -1362,11 +1365,6 @@
>          gst_ticircbuffer_data_consumed(auddec1->circBuf, encDataWindow, 0);
>      }
>
> -    /* Initialize codec engine */
> -    if (gst_tiauddec1_codec_stop(auddec1) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      /* Notify main thread if it is waiting on decode thread shut-down */
>      auddec1->decodeDrained = TRUE;
>      Rendezvous_force(auddec1->waitOnDecodeDrain);
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec_mine.c	2009-07-06
> 16:15:26.000000000 +0300
> @@ -1054,6 +1054,10 @@
>              if (!gst_tiauddec_exit_audio(auddec)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tiauddec_codec_stop(auddec) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          case GST_STATE_CHANGE_READY_TO_PAUSED:
> @@ -1360,12 +1364,6 @@
>          gst_ticircbuffer_data_consumed(auddec->circBuf, encDataWindow, 0);
>      }
>
> -     /* Initialize codec engine */
> -    /* Stop codec engine */
> -    if (gst_tiauddec_codec_stop(auddec) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      /* Notify main thread if it is waiting on decode thread shut-down */
>      auddec->decodeDrained = TRUE;
>      Rendezvous_force(auddec->waitOnDecodeDrain);
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1_mine.c	2009-07-06
> 16:17:11.000000000 +0300
> @@ -1216,6 +1216,10 @@
>              if (!gst_tiimgdec1_exit_image(imgdec1)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1539,11 +1543,6 @@
>          gst_ticircbuffer_data_consumed(imgdec1->circBuf, encDataWindow, 0);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      imgdec1->decodeDrained = TRUE;
>      Rendezvous_force(imgdec1->waitOnDecodeDrain);
>
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec_mine.c	2009-07-06
> 16:20:09.000000000 +0300
> @@ -1216,6 +1216,10 @@
>              if (!gst_tiimgdec_exit_image(imgdec)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tiimgdec_codec_stop(imgdec) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1538,11 +1542,6 @@
>          gst_ticircbuffer_data_consumed(imgdec->circBuf, encDataWindow, 0);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tiimgdec_codec_stop(imgdec) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      imgdec->decodeDrained = TRUE;
>      Rendezvous_force(imgdec->waitOnDecodeDrain);
>
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1.c	2009-06-15
> 22:27:26.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1_mine.c	2009-07-06
> 16:21:36.000000000 +0300
> @@ -1519,6 +1519,10 @@
>              if (!gst_tiimgenc1_exit_image(imgenc1)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1848,11 +1852,6 @@
>          gst_ticircbuffer_data_consumed(imgenc1->circBuf, encDataWindow, 0);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      imgenc1->encodeDrained = TRUE;
>      Rendezvous_force(imgenc1->waitOnEncodeDrain);
>
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc_mine.c	2009-07-06
> 16:22:59.000000000 +0300
> @@ -1518,6 +1518,10 @@
>              if (!gst_tiimgenc_exit_image(imgenc)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tiimgenc_codec_stop(imgenc) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1847,11 +1851,6 @@
>          gst_ticircbuffer_data_consumed(imgenc->circBuf, encDataWindow, 0);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tiimgenc_codec_stop(imgenc) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      imgenc->encodeDrained = TRUE;
>      Rendezvous_force(imgenc->waitOnEncodeDrain);
>
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2_mine.c	2009-07-06
> 16:24:54.000000000 +0300
> @@ -1112,6 +1112,10 @@
>              if (!gst_tividdec2_exit_video(viddec2)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* stop codec engine */
> +            if (gst_tividdec2_codec_stop(viddec2) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          case GST_STATE_CHANGE_READY_TO_PAUSED:
> @@ -1496,11 +1500,6 @@
>          gst_ticircbuffer_data_consumed(viddec2->circBuf, encDataWindow, 0);
>      }
>
> -    /* stop codec engine */
> -    if (gst_tividdec2_codec_stop(viddec2) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      /* Notify main thread if it is waiting on decode thread shut-down */
>      viddec2->decodeDrained = TRUE;
>      Rendezvous_force(viddec2->waitOnDecodeDrain);
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec_mine.c	2009-07-06
> 16:27:06.000000000 +0300
> @@ -1102,6 +1102,10 @@
>              if (!gst_tividdec_exit_video(viddec)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* stop codec engine */
> +            if (gst_tividdec_codec_stop(viddec) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          case GST_STATE_CHANGE_READY_TO_PAUSED:
> @@ -1437,11 +1441,6 @@
>          gst_ticircbuffer_data_consumed(viddec->circBuf, encDataWindow, 0);
>      }
>
> -    /* stop codec engine */
> -    if (gst_tividdec_codec_stop(viddec) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      /* Notify main thread if it is waiting on decode thread shut-down */
>      viddec->decodeDrained = TRUE;
>      Rendezvous_force(viddec->waitOnDecodeDrain);
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1_mine.c	2009-07-06
> 16:28:25.000000000 +0300
> @@ -1077,6 +1077,10 @@
>              if (!gst_tividenc1_exit_video(videnc1)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tividenc1_codec_stop(videnc1) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1532,11 +1536,6 @@
>          Ccv_delete(hCcv);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tividenc1_codec_stop(videnc1) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      videnc1->encodeDrained = TRUE;
>      Rendezvous_force(videnc1->waitOnEncodeDrain);
>      Rendezvous_force(videnc1->waitOnQueueThread);
> ---
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc.c	2009-06-15
> 22:27:27.000000000 +0300
> +++
> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc_mine.c	2009-07-06
> 16:29:48.000000000 +0300
> @@ -1022,6 +1022,10 @@
>              if (!gst_tividenc_exit_video(videnc)) {
>                  return GST_STATE_CHANGE_FAILURE;
>              }
> +            /* Stop codec engine */
> +            if (gst_tividenc_codec_stop(videnc) < 0) {
> +                GST_ERROR("failed to stop codec\n");
> +            }
>              break;
>
>          default:
> @@ -1376,11 +1380,6 @@
>          gst_ticircbuffer_data_consumed(videnc->circBuf, encDataWindow, 0);
>      }
>
> -    /* Stop codec engine */
> -    if (gst_tividenc_codec_stop(videnc) < 0) {
> -        GST_ERROR("failed to stop codec\n");
> -    }
> -
>      /* Notify main thread if it is waiting on decode thread shut-down */
>      videnc->encodeDrained = TRUE;
>      Rendezvous_force(videnc->waitOnQueueThread);
>
>> 2009/9/14, Caglar Akyuz <caglarakyuz@gmail.com>:
>> > On Monday 14 September 2009 13:09:28 yang shaobo wrote:
>> >> Dear Uppal :
>> >> Thanks for your quick reply.
>> >> I modified the $(DSPLINK)/config/all/CFG_Linux.c.
>> >> I changed the Handle signals for cleanup from "TRUE" to "FALSE".
>> >> And , changed NUMSIGNALS from "8u" to "0u".
>> >> Then , I recompiled the dsplink , cmem ,dmai , codec_combos, also
>> >> gstreamer ( I use gstreamer as my application ).
>> >> However , the gstreamer still can not receive signals.
>> >> It seemed that nothing is changed.
>> >> So, I am confused .
>> >
>> > I guess you need to change your codec engine configuration. AFAIK,
>> >  $(DSPLINK)/config/all/CFG_Linux.c file is not used while using codec
>> > engine,
>> > instead CE provides its own configuration. It was far easier for me to
>> > modify
>> > dsplink code for this. Please see the attached patch.
>> >
>> > I hope this helps,
>> > Caglar
>> >
>> > ---
>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>> >/api/Linux/drv_api.c	2008-10-24 22:58:03.000000000 +0300
>> > +++
>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>> >/api/Linux/drv_api_mine.c	2009-07-06 15:45:50.000000000 +0300
>> > @@ -477,7 +477,8 @@
>> >          status = DSP_EPOINTER ;
>> >          SET_FAILURE_REASON ;
>> >      }
>> > -
>> > +
>> > +    DSPLINK_atExitHandler();
>> >      TRC_1LEAVE ("DRV_Finalize", status) ;
>> >
>> >      return status ;
>> > @@ -1606,7 +1607,7 @@
>> >
>> >      TRC_1ENTER ("DRV_installCleanupRoutines", linkCfgPtr) ;
>> >
>> > -    if (linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) {
>> > +    if (0 && linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE)
>> > { sigemptyset (&block_mask) ;
>> >          sigfillset( &block_mask) ;
>> >          sigInstaller.sa_flags   = (SA_RESTART) ;
>> > @@ -1619,7 +1620,6 @@
>> >                         NULL) ;
>> >          }
>> >      }
>> > -    atexit (&DSPLINK_atExitHandler) ;
>> >
>> >      TRC_0LEAVE ("DRV_installCleanupRoutines") ;
>> >  }
>
>
>
yang shaobo Sept. 24, 2009, 2:15 a.m. UTC | #2
Hi, caglar.
After using your patch for dsplink , pipelines using gst-launch works fine.
But some piplines using test-launch such as gst-rtsp-server can not be
stopped by press ctrl c .
I am debugging this issue.
I gusess that the code for test-launch is too simple , without any
signal handler functions.
Howerver , gst-launch.c has some signal handler functions.

Thanks .
Best regards.


2009/9/18, yang shaobo <yangsb05@gmail.com>:
> Thanks again for your patch !
> I will try it as soon as possible .
>
> Best regards.
>
>
> 2009/9/15, Caglar Akyuz <caglarakyuz@gmail.com>:
>> On Tuesday 15 September 2009 04:36:18 yang shaobo wrote:
>>> Dear caglar :
>>> Thanks a lot for your patch !
>>> Now the new dsplink works perfectly with my gstreamer.
>>>
>>> According FAQ on DSPLink wiki, the other thing that should be done may
>>> be adding the dsplink cleanup functions to gstreamer core .
>>> I will try this .
>>>
>>
>> I use something like this.
>>
>> Regards,
>> Caglar
>>
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1_mine.c	2009-07-06
>> 16:13:23.000000000 +0300
>> @@ -1059,6 +1059,9 @@
>>              if (!gst_tiauddec1_exit_audio(auddec1)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            if (gst_tiauddec1_codec_stop(auddec1) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>> @@ -1362,11 +1365,6 @@
>>          gst_ticircbuffer_data_consumed(auddec1->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Initialize codec engine */
>> -    if (gst_tiauddec1_codec_stop(auddec1) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      /* Notify main thread if it is waiting on decode thread shut-down */
>>      auddec1->decodeDrained = TRUE;
>>      Rendezvous_force(auddec1->waitOnDecodeDrain);
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec_mine.c	2009-07-06
>> 16:15:26.000000000 +0300
>> @@ -1054,6 +1054,10 @@
>>              if (!gst_tiauddec_exit_audio(auddec)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tiauddec_codec_stop(auddec) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>> @@ -1360,12 +1364,6 @@
>>          gst_ticircbuffer_data_consumed(auddec->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -     /* Initialize codec engine */
>> -    /* Stop codec engine */
>> -    if (gst_tiauddec_codec_stop(auddec) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      /* Notify main thread if it is waiting on decode thread shut-down */
>>      auddec->decodeDrained = TRUE;
>>      Rendezvous_force(auddec->waitOnDecodeDrain);
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1_mine.c	2009-07-06
>> 16:17:11.000000000 +0300
>> @@ -1216,6 +1216,10 @@
>>              if (!gst_tiimgdec1_exit_image(imgdec1)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1539,11 +1543,6 @@
>>          gst_ticircbuffer_data_consumed(imgdec1->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      imgdec1->decodeDrained = TRUE;
>>      Rendezvous_force(imgdec1->waitOnDecodeDrain);
>>
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec_mine.c	2009-07-06
>> 16:20:09.000000000 +0300
>> @@ -1216,6 +1216,10 @@
>>              if (!gst_tiimgdec_exit_image(imgdec)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tiimgdec_codec_stop(imgdec) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1538,11 +1542,6 @@
>>          gst_ticircbuffer_data_consumed(imgdec->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tiimgdec_codec_stop(imgdec) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      imgdec->decodeDrained = TRUE;
>>      Rendezvous_force(imgdec->waitOnDecodeDrain);
>>
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1.c	2009-06-15
>> 22:27:26.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1_mine.c	2009-07-06
>> 16:21:36.000000000 +0300
>> @@ -1519,6 +1519,10 @@
>>              if (!gst_tiimgenc1_exit_image(imgenc1)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1848,11 +1852,6 @@
>>          gst_ticircbuffer_data_consumed(imgenc1->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      imgenc1->encodeDrained = TRUE;
>>      Rendezvous_force(imgenc1->waitOnEncodeDrain);
>>
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc_mine.c	2009-07-06
>> 16:22:59.000000000 +0300
>> @@ -1518,6 +1518,10 @@
>>              if (!gst_tiimgenc_exit_image(imgenc)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tiimgenc_codec_stop(imgenc) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1847,11 +1851,6 @@
>>          gst_ticircbuffer_data_consumed(imgenc->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tiimgenc_codec_stop(imgenc) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      imgenc->encodeDrained = TRUE;
>>      Rendezvous_force(imgenc->waitOnEncodeDrain);
>>
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2_mine.c	2009-07-06
>> 16:24:54.000000000 +0300
>> @@ -1112,6 +1112,10 @@
>>              if (!gst_tividdec2_exit_video(viddec2)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* stop codec engine */
>> +            if (gst_tividdec2_codec_stop(viddec2) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>> @@ -1496,11 +1500,6 @@
>>          gst_ticircbuffer_data_consumed(viddec2->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* stop codec engine */
>> -    if (gst_tividdec2_codec_stop(viddec2) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      /* Notify main thread if it is waiting on decode thread shut-down */
>>      viddec2->decodeDrained = TRUE;
>>      Rendezvous_force(viddec2->waitOnDecodeDrain);
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec_mine.c	2009-07-06
>> 16:27:06.000000000 +0300
>> @@ -1102,6 +1102,10 @@
>>              if (!gst_tividdec_exit_video(viddec)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* stop codec engine */
>> +            if (gst_tividdec_codec_stop(viddec) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>> @@ -1437,11 +1441,6 @@
>>          gst_ticircbuffer_data_consumed(viddec->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* stop codec engine */
>> -    if (gst_tividdec_codec_stop(viddec) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      /* Notify main thread if it is waiting on decode thread shut-down */
>>      viddec->decodeDrained = TRUE;
>>      Rendezvous_force(viddec->waitOnDecodeDrain);
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1_mine.c	2009-07-06
>> 16:28:25.000000000 +0300
>> @@ -1077,6 +1077,10 @@
>>              if (!gst_tividenc1_exit_video(videnc1)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tividenc1_codec_stop(videnc1) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1532,11 +1536,6 @@
>>          Ccv_delete(hCcv);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tividenc1_codec_stop(videnc1) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      videnc1->encodeDrained = TRUE;
>>      Rendezvous_force(videnc1->waitOnEncodeDrain);
>>      Rendezvous_force(videnc1->waitOnQueueThread);
>> ---
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc.c	2009-06-15
>> 22:27:27.000000000 +0300
>> +++
>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc_mine.c	2009-07-06
>> 16:29:48.000000000 +0300
>> @@ -1022,6 +1022,10 @@
>>              if (!gst_tividenc_exit_video(videnc)) {
>>                  return GST_STATE_CHANGE_FAILURE;
>>              }
>> +            /* Stop codec engine */
>> +            if (gst_tividenc_codec_stop(videnc) < 0) {
>> +                GST_ERROR("failed to stop codec\n");
>> +            }
>>              break;
>>
>>          default:
>> @@ -1376,11 +1380,6 @@
>>          gst_ticircbuffer_data_consumed(videnc->circBuf, encDataWindow,
>> 0);
>>      }
>>
>> -    /* Stop codec engine */
>> -    if (gst_tividenc_codec_stop(videnc) < 0) {
>> -        GST_ERROR("failed to stop codec\n");
>> -    }
>> -
>>      /* Notify main thread if it is waiting on decode thread shut-down */
>>      videnc->encodeDrained = TRUE;
>>      Rendezvous_force(videnc->waitOnQueueThread);
>>
>>> 2009/9/14, Caglar Akyuz <caglarakyuz@gmail.com>:
>>> > On Monday 14 September 2009 13:09:28 yang shaobo wrote:
>>> >> Dear Uppal :
>>> >> Thanks for your quick reply.
>>> >> I modified the $(DSPLINK)/config/all/CFG_Linux.c.
>>> >> I changed the Handle signals for cleanup from "TRUE" to "FALSE".
>>> >> And , changed NUMSIGNALS from "8u" to "0u".
>>> >> Then , I recompiled the dsplink , cmem ,dmai , codec_combos, also
>>> >> gstreamer ( I use gstreamer as my application ).
>>> >> However , the gstreamer still can not receive signals.
>>> >> It seemed that nothing is changed.
>>> >> So, I am confused .
>>> >
>>> > I guess you need to change your codec engine configuration. AFAIK,
>>> >  $(DSPLINK)/config/all/CFG_Linux.c file is not used while using codec
>>> > engine,
>>> > instead CE provides its own configuration. It was far easier for me to
>>> > modify
>>> > dsplink code for this. Please see the attached patch.
>>> >
>>> > I hope this helps,
>>> > Caglar
>>> >
>>> > ---
>>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>>> >/api/Linux/drv_api.c	2008-10-24 22:58:03.000000000 +0300
>>> > +++
>>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>>> >/api/Linux/drv_api_mine.c	2009-07-06 15:45:50.000000000 +0300
>>> > @@ -477,7 +477,8 @@
>>> >          status = DSP_EPOINTER ;
>>> >          SET_FAILURE_REASON ;
>>> >      }
>>> > -
>>> > +
>>> > +    DSPLINK_atExitHandler();
>>> >      TRC_1LEAVE ("DRV_Finalize", status) ;
>>> >
>>> >      return status ;
>>> > @@ -1606,7 +1607,7 @@
>>> >
>>> >      TRC_1ENTER ("DRV_installCleanupRoutines", linkCfgPtr) ;
>>> >
>>> > -    if (linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) {
>>> > +    if (0 && linkCfgPtr->gppObject->gppOsObject->handleSignals ==
>>> > TRUE)
>>> > { sigemptyset (&block_mask) ;
>>> >          sigfillset( &block_mask) ;
>>> >          sigInstaller.sa_flags   = (SA_RESTART) ;
>>> > @@ -1619,7 +1620,6 @@
>>> >                         NULL) ;
>>> >          }
>>> >      }
>>> > -    atexit (&DSPLINK_atExitHandler) ;
>>> >
>>> >      TRC_0LEAVE ("DRV_installCleanupRoutines") ;
>>> >  }
>>
>>
>>
>
yang shaobo Sept. 25, 2009, 5:17 a.m. UTC | #3
I add a signal handler to the tes-launch.c .
The program can receive the SIGINT correctly.
Howerver , when I use kill function to end the process , it becomes a
defunct process .
I don't know why .
Can any one to give some advice ?


Thanks.
Best regards.

2009/9/24, yang shaobo <yangsb05@gmail.com>:
> Hi, caglar.
> After using your patch for dsplink , pipelines using gst-launch works fine.
> But some piplines using test-launch such as gst-rtsp-server can not be
> stopped by press ctrl c .
> I am debugging this issue.
> I gusess that the code for test-launch is too simple , without any
> signal handler functions.
> Howerver , gst-launch.c has some signal handler functions.
>
> Thanks .
> Best regards.
>
>
> 2009/9/18, yang shaobo <yangsb05@gmail.com>:
>> Thanks again for your patch !
>> I will try it as soon as possible .
>>
>> Best regards.
>>
>>
>> 2009/9/15, Caglar Akyuz <caglarakyuz@gmail.com>:
>>> On Tuesday 15 September 2009 04:36:18 yang shaobo wrote:
>>>> Dear caglar :
>>>> Thanks a lot for your patch !
>>>> Now the new dsplink works perfectly with my gstreamer.
>>>>
>>>> According FAQ on DSPLink wiki, the other thing that should be done may
>>>> be adding the dsplink cleanup functions to gstreamer core .
>>>> I will try this .
>>>>
>>>
>>> I use something like this.
>>>
>>> Regards,
>>> Caglar
>>>
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1_mine.c	2009-07-06
>>> 16:13:23.000000000 +0300
>>> @@ -1059,6 +1059,9 @@
>>>              if (!gst_tiauddec1_exit_audio(auddec1)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            if (gst_tiauddec1_codec_stop(auddec1) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>>> @@ -1362,11 +1365,6 @@
>>>          gst_ticircbuffer_data_consumed(auddec1->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Initialize codec engine */
>>> -    if (gst_tiauddec1_codec_stop(auddec1) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      /* Notify main thread if it is waiting on decode thread shut-down
>>> */
>>>      auddec1->decodeDrained = TRUE;
>>>      Rendezvous_force(auddec1->waitOnDecodeDrain);
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec_mine.c	2009-07-06
>>> 16:15:26.000000000 +0300
>>> @@ -1054,6 +1054,10 @@
>>>              if (!gst_tiauddec_exit_audio(auddec)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tiauddec_codec_stop(auddec) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>>> @@ -1360,12 +1364,6 @@
>>>          gst_ticircbuffer_data_consumed(auddec->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -     /* Initialize codec engine */
>>> -    /* Stop codec engine */
>>> -    if (gst_tiauddec_codec_stop(auddec) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      /* Notify main thread if it is waiting on decode thread shut-down
>>> */
>>>      auddec->decodeDrained = TRUE;
>>>      Rendezvous_force(auddec->waitOnDecodeDrain);
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1_mine.c	2009-07-06
>>> 16:17:11.000000000 +0300
>>> @@ -1216,6 +1216,10 @@
>>>              if (!gst_tiimgdec1_exit_image(imgdec1)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1539,11 +1543,6 @@
>>>          gst_ticircbuffer_data_consumed(imgdec1->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      imgdec1->decodeDrained = TRUE;
>>>      Rendezvous_force(imgdec1->waitOnDecodeDrain);
>>>
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec_mine.c	2009-07-06
>>> 16:20:09.000000000 +0300
>>> @@ -1216,6 +1216,10 @@
>>>              if (!gst_tiimgdec_exit_image(imgdec)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tiimgdec_codec_stop(imgdec) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1538,11 +1542,6 @@
>>>          gst_ticircbuffer_data_consumed(imgdec->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tiimgdec_codec_stop(imgdec) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      imgdec->decodeDrained = TRUE;
>>>      Rendezvous_force(imgdec->waitOnDecodeDrain);
>>>
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1.c	2009-06-15
>>> 22:27:26.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1_mine.c	2009-07-06
>>> 16:21:36.000000000 +0300
>>> @@ -1519,6 +1519,10 @@
>>>              if (!gst_tiimgenc1_exit_image(imgenc1)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1848,11 +1852,6 @@
>>>          gst_ticircbuffer_data_consumed(imgenc1->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      imgenc1->encodeDrained = TRUE;
>>>      Rendezvous_force(imgenc1->waitOnEncodeDrain);
>>>
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc_mine.c	2009-07-06
>>> 16:22:59.000000000 +0300
>>> @@ -1518,6 +1518,10 @@
>>>              if (!gst_tiimgenc_exit_image(imgenc)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tiimgenc_codec_stop(imgenc) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1847,11 +1851,6 @@
>>>          gst_ticircbuffer_data_consumed(imgenc->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tiimgenc_codec_stop(imgenc) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      imgenc->encodeDrained = TRUE;
>>>      Rendezvous_force(imgenc->waitOnEncodeDrain);
>>>
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2_mine.c	2009-07-06
>>> 16:24:54.000000000 +0300
>>> @@ -1112,6 +1112,10 @@
>>>              if (!gst_tividdec2_exit_video(viddec2)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* stop codec engine */
>>> +            if (gst_tividdec2_codec_stop(viddec2) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>>> @@ -1496,11 +1500,6 @@
>>>          gst_ticircbuffer_data_consumed(viddec2->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* stop codec engine */
>>> -    if (gst_tividdec2_codec_stop(viddec2) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      /* Notify main thread if it is waiting on decode thread shut-down
>>> */
>>>      viddec2->decodeDrained = TRUE;
>>>      Rendezvous_force(viddec2->waitOnDecodeDrain);
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec_mine.c	2009-07-06
>>> 16:27:06.000000000 +0300
>>> @@ -1102,6 +1102,10 @@
>>>              if (!gst_tividdec_exit_video(viddec)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* stop codec engine */
>>> +            if (gst_tividdec_codec_stop(viddec) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          case GST_STATE_CHANGE_READY_TO_PAUSED:
>>> @@ -1437,11 +1441,6 @@
>>>          gst_ticircbuffer_data_consumed(viddec->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* stop codec engine */
>>> -    if (gst_tividdec_codec_stop(viddec) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      /* Notify main thread if it is waiting on decode thread shut-down
>>> */
>>>      viddec->decodeDrained = TRUE;
>>>      Rendezvous_force(viddec->waitOnDecodeDrain);
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1_mine.c	2009-07-06
>>> 16:28:25.000000000 +0300
>>> @@ -1077,6 +1077,10 @@
>>>              if (!gst_tividenc1_exit_video(videnc1)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tividenc1_codec_stop(videnc1) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1532,11 +1536,6 @@
>>>          Ccv_delete(hCcv);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tividenc1_codec_stop(videnc1) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      videnc1->encodeDrained = TRUE;
>>>      Rendezvous_force(videnc1->waitOnEncodeDrain);
>>>      Rendezvous_force(videnc1->waitOnQueueThread);
>>> ---
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc.c	2009-06-15
>>> 22:27:27.000000000 +0300
>>> +++
>>> gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc_mine.c	2009-07-06
>>> 16:29:48.000000000 +0300
>>> @@ -1022,6 +1022,10 @@
>>>              if (!gst_tividenc_exit_video(videnc)) {
>>>                  return GST_STATE_CHANGE_FAILURE;
>>>              }
>>> +            /* Stop codec engine */
>>> +            if (gst_tividenc_codec_stop(videnc) < 0) {
>>> +                GST_ERROR("failed to stop codec\n");
>>> +            }
>>>              break;
>>>
>>>          default:
>>> @@ -1376,11 +1380,6 @@
>>>          gst_ticircbuffer_data_consumed(videnc->circBuf, encDataWindow,
>>> 0);
>>>      }
>>>
>>> -    /* Stop codec engine */
>>> -    if (gst_tividenc_codec_stop(videnc) < 0) {
>>> -        GST_ERROR("failed to stop codec\n");
>>> -    }
>>> -
>>>      /* Notify main thread if it is waiting on decode thread shut-down
>>> */
>>>      videnc->encodeDrained = TRUE;
>>>      Rendezvous_force(videnc->waitOnQueueThread);
>>>
>>>> 2009/9/14, Caglar Akyuz <caglarakyuz@gmail.com>:
>>>> > On Monday 14 September 2009 13:09:28 yang shaobo wrote:
>>>> >> Dear Uppal :
>>>> >> Thanks for your quick reply.
>>>> >> I modified the $(DSPLINK)/config/all/CFG_Linux.c.
>>>> >> I changed the Handle signals for cleanup from "TRUE" to "FALSE".
>>>> >> And , changed NUMSIGNALS from "8u" to "0u".
>>>> >> Then , I recompiled the dsplink , cmem ,dmai , codec_combos, also
>>>> >> gstreamer ( I use gstreamer as my application ).
>>>> >> However , the gstreamer still can not receive signals.
>>>> >> It seemed that nothing is changed.
>>>> >> So, I am confused .
>>>> >
>>>> > I guess you need to change your codec engine configuration. AFAIK,
>>>> >  $(DSPLINK)/config/all/CFG_Linux.c file is not used while using codec
>>>> > engine,
>>>> > instead CE provides its own configuration. It was far easier for me
>>>> > to
>>>> > modify
>>>> > dsplink code for this. Please see the attached patch.
>>>> >
>>>> > I hope this helps,
>>>> > Caglar
>>>> >
>>>> > ---
>>>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>>>> >/api/Linux/drv_api.c	2008-10-24 22:58:03.000000000 +0300
>>>> > +++
>>>> > ti-codec-engine-221-r0/codec_engine_2_21/cetools/packages/dsplink/gpp/src
>>>> >/api/Linux/drv_api_mine.c	2009-07-06 15:45:50.000000000 +0300
>>>> > @@ -477,7 +477,8 @@
>>>> >          status = DSP_EPOINTER ;
>>>> >          SET_FAILURE_REASON ;
>>>> >      }
>>>> > -
>>>> > +
>>>> > +    DSPLINK_atExitHandler();
>>>> >      TRC_1LEAVE ("DRV_Finalize", status) ;
>>>> >
>>>> >      return status ;
>>>> > @@ -1606,7 +1607,7 @@
>>>> >
>>>> >      TRC_1ENTER ("DRV_installCleanupRoutines", linkCfgPtr) ;
>>>> >
>>>> > -    if (linkCfgPtr->gppObject->gppOsObject->handleSignals == TRUE) {
>>>> > +    if (0 && linkCfgPtr->gppObject->gppOsObject->handleSignals ==
>>>> > TRUE)
>>>> > { sigemptyset (&block_mask) ;
>>>> >          sigfillset( &block_mask) ;
>>>> >          sigInstaller.sa_flags   = (SA_RESTART) ;
>>>> > @@ -1619,7 +1620,6 @@
>>>> >                         NULL) ;
>>>> >          }
>>>> >      }
>>>> > -    atexit (&DSPLINK_atExitHandler) ;
>>>> >
>>>> >      TRC_0LEAVE ("DRV_installCleanupRoutines") ;
>>>> >  }
>>>
>>>
>>>
>>
>
Yusuf Caglar AKYUZ Sept. 25, 2009, 5:53 a.m. UTC | #4
On Friday 25 September 2009 08:17:36 yang shaobo wrote:
> I add a signal handler to the tes-launch.c .
> The program can receive the SIGINT correctly.
> Howerver , when I use kill function to end the process , it becomes a
> defunct process .
> I don't know why .
> Can any one to give some advice ?
>

After receiving SIGINT you should close all dsp resources and then terminate.

BTW, gst-launch should work fine as well. I don't know anything about test 
program you are mentioning.

Regards,
Caglar
diff mbox

Patch

--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec1_mine.c	2009-07-06 16:13:23.000000000 +0300
@@ -1059,6 +1059,9 @@ 
             if (!gst_tiauddec1_exit_audio(auddec1)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            if (gst_tiauddec1_codec_stop(auddec1) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         case GST_STATE_CHANGE_READY_TO_PAUSED:
@@ -1362,11 +1365,6 @@ 
         gst_ticircbuffer_data_consumed(auddec1->circBuf, encDataWindow, 0);
     }
 
-    /* Initialize codec engine */
-    if (gst_tiauddec1_codec_stop(auddec1) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     /* Notify main thread if it is waiting on decode thread shut-down */
     auddec1->decodeDrained = TRUE;
     Rendezvous_force(auddec1->waitOnDecodeDrain);
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiauddec_mine.c	2009-07-06 16:15:26.000000000 +0300
@@ -1054,6 +1054,10 @@ 
             if (!gst_tiauddec_exit_audio(auddec)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tiauddec_codec_stop(auddec) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         case GST_STATE_CHANGE_READY_TO_PAUSED:
@@ -1360,12 +1364,6 @@ 
         gst_ticircbuffer_data_consumed(auddec->circBuf, encDataWindow, 0);
     }
 
-     /* Initialize codec engine */
-    /* Stop codec engine */
-    if (gst_tiauddec_codec_stop(auddec) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     /* Notify main thread if it is waiting on decode thread shut-down */
     auddec->decodeDrained = TRUE;
     Rendezvous_force(auddec->waitOnDecodeDrain);
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec1_mine.c	2009-07-06 16:17:11.000000000 +0300
@@ -1216,6 +1216,10 @@ 
             if (!gst_tiimgdec1_exit_image(imgdec1)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1539,11 +1543,6 @@ 
         gst_ticircbuffer_data_consumed(imgdec1->circBuf, encDataWindow, 0);
     }
 
-    /* Stop codec engine */
-    if (gst_tiimgdec1_codec_stop(imgdec1) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     imgdec1->decodeDrained = TRUE;
     Rendezvous_force(imgdec1->waitOnDecodeDrain);
 
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgdec_mine.c	2009-07-06 16:20:09.000000000 +0300
@@ -1216,6 +1216,10 @@ 
             if (!gst_tiimgdec_exit_image(imgdec)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tiimgdec_codec_stop(imgdec) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1538,11 +1542,6 @@ 
         gst_ticircbuffer_data_consumed(imgdec->circBuf, encDataWindow, 0);
     }
 
-    /* Stop codec engine */
-    if (gst_tiimgdec_codec_stop(imgdec) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     imgdec->decodeDrained = TRUE;
     Rendezvous_force(imgdec->waitOnDecodeDrain);
 
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1.c	2009-06-15 22:27:26.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc1_mine.c	2009-07-06 16:21:36.000000000 +0300
@@ -1519,6 +1519,10 @@ 
             if (!gst_tiimgenc1_exit_image(imgenc1)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1848,11 +1852,6 @@ 
         gst_ticircbuffer_data_consumed(imgenc1->circBuf, encDataWindow, 0);
     }
 
-    /* Stop codec engine */
-    if (gst_tiimgenc1_codec_stop(imgenc1) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     imgenc1->encodeDrained = TRUE;
     Rendezvous_force(imgenc1->waitOnEncodeDrain);
 
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttiimgenc_mine.c	2009-07-06 16:22:59.000000000 +0300
@@ -1518,6 +1518,10 @@ 
             if (!gst_tiimgenc_exit_image(imgenc)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tiimgenc_codec_stop(imgenc) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1847,11 +1851,6 @@ 
         gst_ticircbuffer_data_consumed(imgenc->circBuf, encDataWindow, 0);
     }
 
-    /* Stop codec engine */
-    if (gst_tiimgenc_codec_stop(imgenc) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     imgenc->encodeDrained = TRUE;
     Rendezvous_force(imgenc->waitOnEncodeDrain);
 
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec2_mine.c	2009-07-06 16:24:54.000000000 +0300
@@ -1112,6 +1112,10 @@ 
             if (!gst_tividdec2_exit_video(viddec2)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* stop codec engine */
+            if (gst_tividdec2_codec_stop(viddec2) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         case GST_STATE_CHANGE_READY_TO_PAUSED:
@@ -1496,11 +1500,6 @@ 
         gst_ticircbuffer_data_consumed(viddec2->circBuf, encDataWindow, 0);
     }
 
-    /* stop codec engine */
-    if (gst_tividdec2_codec_stop(viddec2) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     /* Notify main thread if it is waiting on decode thread shut-down */
     viddec2->decodeDrained = TRUE;
     Rendezvous_force(viddec2->waitOnDecodeDrain);
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividdec_mine.c	2009-07-06 16:27:06.000000000 +0300
@@ -1102,6 +1102,10 @@ 
             if (!gst_tividdec_exit_video(viddec)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* stop codec engine */
+            if (gst_tividdec_codec_stop(viddec) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         case GST_STATE_CHANGE_READY_TO_PAUSED:
@@ -1437,11 +1441,6 @@ 
         gst_ticircbuffer_data_consumed(viddec->circBuf, encDataWindow, 0);
     }
 
-    /* stop codec engine */
-    if (gst_tividdec_codec_stop(viddec) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     /* Notify main thread if it is waiting on decode thread shut-down */
     viddec->decodeDrained = TRUE;
     Rendezvous_force(viddec->waitOnDecodeDrain);
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc1_mine.c	2009-07-06 16:28:25.000000000 +0300
@@ -1077,6 +1077,10 @@ 
             if (!gst_tividenc1_exit_video(videnc1)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tividenc1_codec_stop(videnc1) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1532,11 +1536,6 @@ 
         Ccv_delete(hCcv);
     }
 
-    /* Stop codec engine */
-    if (gst_tividenc1_codec_stop(videnc1) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     videnc1->encodeDrained = TRUE;
     Rendezvous_force(videnc1->waitOnEncodeDrain);
     Rendezvous_force(videnc1->waitOnQueueThread);
--- gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc.c	2009-06-15 22:27:27.000000000 +0300
+++ gstreamer-ti-0+svnr225-r0/gstreamer_ti/ti_build/ticodecplugin/src/gsttividenc_mine.c	2009-07-06 16:29:48.000000000 +0300
@@ -1022,6 +1022,10 @@ 
             if (!gst_tividenc_exit_video(videnc)) {
                 return GST_STATE_CHANGE_FAILURE;
             }
+            /* Stop codec engine */
+            if (gst_tividenc_codec_stop(videnc) < 0) {
+                GST_ERROR("failed to stop codec\n");
+            }
             break;
 
         default:
@@ -1376,11 +1380,6 @@ 
         gst_ticircbuffer_data_consumed(videnc->circBuf, encDataWindow, 0);
     }
 
-    /* Stop codec engine */
-    if (gst_tividenc_codec_stop(videnc) < 0) {
-        GST_ERROR("failed to stop codec\n");
-    }
-
     /* Notify main thread if it is waiting on decode thread shut-down */
     videnc->encodeDrained = TRUE;
     Rendezvous_force(videnc->waitOnQueueThread);