mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-25 00:22:19 +00:00
Remove sc_demuxer_parse()
Now that the key frame flag is known, parsing the packet is useless.
This commit is contained in:
parent
67068e4e3d
commit
1c02b58412
@ -73,6 +73,7 @@ sc_demuxer_recv_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
|
||||
packet->flags |= AV_PKT_FLAG_KEY;
|
||||
}
|
||||
|
||||
packet->dts = packet->pts;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -89,28 +90,6 @@ push_packet_to_sinks(struct sc_demuxer *demuxer, const AVPacket *packet) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
sc_demuxer_parse(struct sc_demuxer *demuxer, AVPacket *packet) {
|
||||
uint8_t *in_data = packet->data;
|
||||
int in_len = packet->size;
|
||||
uint8_t *out_data = NULL;
|
||||
int out_len = 0;
|
||||
int r = av_parser_parse2(demuxer->parser, demuxer->codec_ctx,
|
||||
&out_data, &out_len, in_data, in_len,
|
||||
AV_NOPTS_VALUE, AV_NOPTS_VALUE, -1);
|
||||
|
||||
// PARSER_FLAG_COMPLETE_FRAMES is set
|
||||
assert(r == in_len);
|
||||
(void) r;
|
||||
assert(out_len == in_len);
|
||||
|
||||
if (demuxer->parser->key_frame == 1) {
|
||||
packet->flags |= AV_PKT_FLAG_KEY;
|
||||
}
|
||||
|
||||
packet->dts = packet->pts;
|
||||
}
|
||||
|
||||
static bool
|
||||
sc_demuxer_push_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
|
||||
bool is_config = packet->pts == AV_NOPTS_VALUE;
|
||||
@ -150,11 +129,6 @@ sc_demuxer_push_packet(struct sc_demuxer *demuxer, AVPacket *packet) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_config) {
|
||||
// data packet
|
||||
sc_demuxer_parse(demuxer, packet);
|
||||
}
|
||||
|
||||
bool ok = push_packet_to_sinks(demuxer, packet);
|
||||
|
||||
if (!is_config && demuxer->pending) {
|
||||
|
Loading…
Reference in New Issue
Block a user