Introduce VideoFrame::id to keep track of frames inside application.

Also switch webrtc code from deprecated constructors to the builder API.

Change-Id: Ie325bf1e9b4ff1e413fef3431ced8ed9ff725107
Bug: webrtc:10138
Reviewed-on: https://webrtc-review.googlesource.com/c/114422
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26132}
This commit is contained in:
Artem Titov
2019-01-03 23:49:37 +01:00
committed by Commit Bot
parent 12cea05119
commit 1ebfb6aac7
47 changed files with 538 additions and 179 deletions

View File

@ -20,6 +20,7 @@ extern "C" {
#include "third_party/ffmpeg/libavutil/imgutils.h"
} // extern "C"
#include "absl/memory/memory.h"
#include "api/video/color_space.h"
#include "api/video/i420_buffer.h"
#include "common_video/include/video_frame_buffer.h"
@ -120,12 +121,14 @@ int H264DecoderImpl::AVGetBuffer2(
// TODO(nisse): The VideoFrame's timestamp and rotation info is not used.
// Refactor to do not use a VideoFrame object at all.
av_frame->buf[0] = av_buffer_create(
av_frame->data[kYPlaneIndex],
total_size,
AVFreeBuffer2,
static_cast<void*>(new VideoFrame(frame_buffer,
kVideoRotation_0,
0 /* timestamp_us */)),
av_frame->data[kYPlaneIndex], total_size, AVFreeBuffer2,
static_cast<void*>(absl::make_unique<VideoFrame>(
VideoFrame::Builder()
.set_video_frame_buffer(frame_buffer)
.set_rotation(kVideoRotation_0)
.set_timestamp_us(0)
.build())
.release()),
0);
RTC_CHECK(av_frame->buf[0]);
return 0;