|
@@ -63,8 +63,13 @@ void StreamNode::work_gpu()
|
|
printf("packet_size = %d\n", packet_size);
|
|
printf("packet_size = %d\n", packet_size);
|
|
|
|
|
|
unsigned int frame_index = 0;
|
|
unsigned int frame_index = 0;
|
|
- do{
|
|
|
|
|
|
+ while(running_)
|
|
|
|
+ {
|
|
demuxer_->demux(&packet_data, &packet_size, &pts);
|
|
demuxer_->demux(&packet_data, &packet_size, &pts);
|
|
|
|
+ if (packet_size <= 0 || !running_)
|
|
|
|
+ {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
int ndecoded_frame = decoder_->decode(packet_data, packet_size, pts);
|
|
int ndecoded_frame = decoder_->decode(packet_data, packet_size, pts);
|
|
for(int i = 0; i < ndecoded_frame; ++i){
|
|
for(int i = 0; i < ndecoded_frame; ++i){
|
|
|
|
|
|
@@ -94,7 +99,7 @@ void StreamNode::work_gpu()
|
|
// printf("Node %s push data to %s\n", name_.c_str(), output_buffer.first.c_str());
|
|
// printf("Node %s push data to %s\n", name_.c_str(), output_buffer.first.c_str());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }while(packet_size > 0 && running_);
|
|
|
|
|
|
+ };
|
|
printf("C++ Demo: %d frames\n", frame_index);
|
|
printf("C++ Demo: %d frames\n", frame_index);
|
|
}
|
|
}
|
|
|
|
|