base::OnceCallback<void(scoped_refptr<TTvdDecodedFrame>)> result_cb,
base::RepeatingCallback<void(base::WeakPtr<TTvdDecodedFrame>,
OverlayRenderCb)> render_cb,
- base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb) {
+ base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb,
+ const gpu::GpuDriverBugWorkarounds* workarounds) {
scoped_refptr<TTvdDecodedFrame> result(new TTvdDecodedFrame(
coded_size, natural_size, std::move(command_buffer_helper),
- std::move(gpu_task_runner), std::move(release_cb)));
+ std::move(gpu_task_runner), std::move(release_cb), workarounds));
TTvdDecodedFrame* raw_result = result.get();
raw_result->InitializeGpuPart(
allocate_memory, plane_collection,
gfx::Size natural_size,
scoped_refptr<CommandBufferHelper> command_buffer_helper,
scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner,
- base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb)
+ base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb,
+ const gpu::GpuDriverBugWorkarounds* workarounds)
: natural_size_(natural_size),
picture_size_(coded_size),
decoded_size_(coded_size),
command_buffer_helper_(std::move(command_buffer_helper)),
gpu_task_runner_(std::move(gpu_task_runner)),
- release_cb_(std::move(release_cb)) {
+ release_cb_(std::move(release_cb)),
+ workarounds_(workarounds) {
weak_this_ = weak_factory_.GetWeakPtr();
}
}
TRACE_EVENT0("gpu", "TTvdDecodedFrame.Copy");
-#if TIZEN_VERSION_AT_LEAST(6, 5, 0)
- if (!CopyFrameDataParallel(nv12_data, pixmap_.get(), picture_size_)) {
- TIZEN_MEDIA_LOG(ERROR) << "Error while copying frame data";
- }
-#else
- // When writing into the same buffer in parallel from different threads,
- // like it's possible in |CopyFrameDataParallel| method, there were some
- // weird crashes (SIGBUS). It always occured from side thread that tries
- // to copy data.
- // Now we won't be using heavy parallelization, possibly splitting single
- // plane into multiple copying task. However, copying large video frame might
- // be slow, so instead stick with processing each plane separately to speed up
- // this task.
- // TODO(VDGAME-485) There should be area to optimize it, possible with
- // mapping with offset or even get rid of this issue.
- if (!CopyNv12FramePlanesParallel(nv12_data, pixmap_.get(), picture_size_)) {
- TIZEN_MEDIA_LOG(ERROR) << "Error while copying frame data";
+ if (workarounds_->ttvd_disable_buffer_parallel_copy) {
+ // When writing into the same buffer in parallel from different threads,
+ // like it's possible in |CopyFrameDataParallel| method, there were some
+ // weird crashes (SIGBUS). It always occured from side thread that tries
+ // to copy data.
+ // Now we won't be using heavy parallelization, possibly splitting single
+ // plane into multiple copying task. However, copying large video frame
+ // might be slow, so instead stick with processing each plane separately
+ // to speed up this task.
+ // TODO(VDGAME-485) There should be area to optimize it, possible with
+ // mapping with offset or even get rid of this issue.
+ if (!CopyNv12FramePlanesParallel(nv12_data, pixmap_.get(), picture_size_)) {
+ TIZEN_MEDIA_LOG(ERROR) << "Error while copying frame data";
+ }
+ } else {
+ if (!CopyFrameDataParallel(nv12_data, pixmap_.get(), picture_size_)) {
+ TIZEN_MEDIA_LOG(ERROR) << "Error while copying frame data";
+ }
}
-#endif // TIZEN_VERSION_AT_LEAST(6, 5, 0)
}
void TTvdDecodedFrame::ClearLazyData() {
#include "base/unguessable_token.h"
#include "command_buffer/common/mailbox.h"
#include "command_buffer/common/sync_token.h"
+#include "gpu/config/gpu_driver_bug_workarounds.h"
#include "gpu/ipc/common/gpu_memory_buffer_impl_native_pixmap.h"
#include "gpu/ipc/service/shared_image_stub.h"
#include "media/base/video_frame.h"
base::OnceCallback<void(scoped_refptr<TTvdDecodedFrame>)> result_cb,
base::RepeatingCallback<void(base::WeakPtr<TTvdDecodedFrame>,
OverlayRenderCb)> render_cb,
- base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)>
- release_cb);
+ base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb,
+ const gpu::GpuDriverBugWorkarounds* workarounds);
~TTvdDecodedFrame();
scoped_refptr<VideoFrame> CreateVideoFrame(base::TimeDelta timestamp);
gfx::Size natural_size,
scoped_refptr<CommandBufferHelper> command_buffer_helper,
scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner,
- base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)>
- release_cb);
+ base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb,
+ const gpu::GpuDriverBugWorkarounds* workarounds);
void VideoFrameDestroyed(const gpu::SyncToken& sync_token);
std::unique_ptr<TTvdDecodedFrameOnGpu> frame_on_gpu_;
base::RepeatingCallback<void(scoped_refptr<TTvdDecodedFrame>)> release_cb_;
+ const gpu::GpuDriverBugWorkarounds* workarounds_;
+
base::WeakPtr<TTvdDecodedFrame> weak_this_;
base::WeakPtrFactory<TTvdDecodedFrame> weak_factory_{this};
};