modules/media/src/main/native/gstreamer/plugins/vp6/flvdemux.c

Print this page




 857                     GArray *metalist = filter->metadata->keyframes;
 858                     for (index = 0; index < metalist->len; index++) {
 859                         FlvKeyframe entry = g_array_index(metalist, FlvKeyframe, index);
 860                         flv_demux_index_add_entry(filter, entry.time, entry.fileposition);
 861                     }
 862                     filter->copied_metadata_keyframes = TRUE;
 863                 }
 864             } else {
 865                 //fprintf(stderr, "flv_demux_chain() : Error parsing buffer : %d\n", parse_result);
 866                 result = GST_FLOW_ERROR;
 867             }
 868             break;
 869         }
 870         default: {
 871             //fprintf(stderr, "flv_demux_chain() : Illegal state\n");
 872             result = GST_FLOW_ERROR;
 873             break;
 874         }
 875     }
 876 
 877     if (result == GST_FLOW_ERROR) {
 878         gst_element_message_full(GST_ELEMENT(filter), GST_MESSAGE_ERROR, GST_STREAM_ERROR, GST_STREAM_ERROR_DEMUX, g_strdup("Failed to demux FLV stream"), NULL, ("flvdemux.c"), ("flv_demux_parse_next_block"), 0);
 879     }
 880 
 881     return result;
 882 }
 883 
 884 /* chain function
 885  * this function does the actual processing
 886  */
 887 static GstFlowReturn flv_demux_chain (GstPad * pad, GstBuffer * buf)
 888 {
 889     //fprintf(stderr, "===flv_demux_chain()\n");
 890     FlvDemux *filter;
 891     GstAdapter *adapter;
 892     GstFlowReturn result = GST_FLOW_OK;
 893 
 894     filter = FLV_DEMUX (GST_OBJECT_PARENT (pad));
 895     adapter = filter->adapter;
 896 
 897     if (filter->need_parser_flush) {
 898         filter->need_parser_flush = FALSE;
 899         gst_adapter_clear(adapter);
 900         if (GST_BUFFER_OFFSET(buf) != 0) {




 857                     GArray *metalist = filter->metadata->keyframes;
 858                     for (index = 0; index < metalist->len; index++) {
 859                         FlvKeyframe entry = g_array_index(metalist, FlvKeyframe, index);
 860                         flv_demux_index_add_entry(filter, entry.time, entry.fileposition);
 861                     }
 862                     filter->copied_metadata_keyframes = TRUE;
 863                 }
 864             } else {
 865                 //fprintf(stderr, "flv_demux_chain() : Error parsing buffer : %d\n", parse_result);
 866                 result = GST_FLOW_ERROR;
 867             }
 868             break;
 869         }
 870         default: {
 871             //fprintf(stderr, "flv_demux_chain() : Illegal state\n");
 872             result = GST_FLOW_ERROR;
 873             break;
 874         }
 875     }
 876 




 877     return result;
 878 }
 879 
 880 /* chain function
 881  * this function does the actual processing
 882  */
 883 static GstFlowReturn flv_demux_chain (GstPad * pad, GstBuffer * buf)
 884 {
 885     //fprintf(stderr, "===flv_demux_chain()\n");
 886     FlvDemux *filter;
 887     GstAdapter *adapter;
 888     GstFlowReturn result = GST_FLOW_OK;
 889 
 890     filter = FLV_DEMUX (GST_OBJECT_PARENT (pad));
 891     adapter = filter->adapter;
 892 
 893     if (filter->need_parser_flush) {
 894         filter->need_parser_flush = FALSE;
 895         gst_adapter_clear(adapter);
 896         if (GST_BUFFER_OFFSET(buf) != 0) {