获取AMR格式音频的当前播放位置

    技术2022-05-20  48

    int gst_rec_get_play_position(){   GstQuery *query;   GstFormat format;   gint64 position;   gint64 ret_value;

     

       if((APP_STATE_PLAY != app.state) || (NULL == app.play_pipeline))   {      return -1;   }

     

       format = GST_FORMAT_TIME;

       query = gst_query_new_position (format);

       if (gst_element_query(app.play_pipeline, query))    {       gst_query_parse_position (query, NULL, &position);   }    else   {      position = 0;   }

       gst_query_unref (query);

       ret_value = position / GST_SECOND;               return ret_value; }


    最新回复(0)