Browse Source

[vic] Quick change on VP9 offsets + ifdef encoding flags for Android

lsfg-android
CamilleLaVey 4 weeks ago
parent
commit
6df0089950
  1. 2
      src/video_core/host1x/codecs/decoder.cpp
  2. 6
      src/video_core/host1x/ffmpeg.cpp

2
src/video_core/host1x/codecs/decoder.cpp

@ -59,7 +59,7 @@ void Decoder::Decode() {
while (auto result = decode_api.ReceiveFrame()) { while (auto result = decode_api.ReceiveFrame()) {
auto& [frame, frame_offsets] = *result; auto& [frame, frame_offsets] = *result;
if (frame_offsets.hidden || !frame) {
if (!frame) {
continue; continue;
} }
if (frame_offsets.interlaced) { if (frame_offsets.interlaced) {

6
src/video_core/host1x/ffmpeg.cpp

@ -281,8 +281,10 @@ DecoderContext::DecoderContext(const Decoder& decoder) : m_decoder{decoder} {
av_opt_set(m_codec_context->priv_data, "tune", "zerolatency", 0); av_opt_set(m_codec_context->priv_data, "tune", "zerolatency", 0);
m_codec_context->thread_count = 0; m_codec_context->thread_count = 0;
m_codec_context->thread_type &= ~FF_THREAD_FRAME; m_codec_context->thread_type &= ~FF_THREAD_FRAME;
#if defined(__ANDROID__)
m_codec_context->flags |= AV_CODEC_FLAG_LOW_DELAY; m_codec_context->flags |= AV_CODEC_FLAG_LOW_DELAY;
m_codec_context->flags2 |= AV_CODEC_FLAG2_FAST; m_codec_context->flags2 |= AV_CODEC_FLAG2_FAST;
#endif
} }
DecoderContext::~DecoderContext() { DecoderContext::~DecoderContext() {
@ -435,7 +437,9 @@ bool DecodeApi::SendPacket(std::span<const u8> packet_data, const FrameOffsets&
} }
m_opened = true; m_opened = true;
} }
m_pending_offsets.push(offsets);
if (!offsets.hidden) {
m_pending_offsets.push(offsets);
}
FFmpeg::Packet packet(packet_data); FFmpeg::Packet packet(packet_data);
packet.GetPacket()->pts = m_next_pts; packet.GetPacket()->pts = m_next_pts;
packet.GetPacket()->dts = m_next_pts; packet.GetPacket()->dts = m_next_pts;

Loading…
Cancel
Save