Commit fdd3b55c authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: fix chromium-style errors.

We have a lot of chromium-style errors happening when enabling V4L2 for
a non-Chrome OS build, e.g:

../../media/gpu/v4l2/v4l2_decode_surface.h:139:7: error: [chromium-style] Classes that are ref-counted should have explicit destructors that are declared protected or private.
class V4L2RequestDecodeSurface : public V4L2DecodeSurface {

and

../../media/gpu/v4l2/v4l2_slice_video_decoder.h:97:5: error: [chromium-style] Complex constructor has an inlined body.
    DecodeRequest(scoped_refptr<DecoderBuffer> buf, DecodeCB cb, int32_t id)

This CL fixes these errors.

Bug: 990690
Test: VDA unittest passes on Kukui.
Change-Id: I3485c855f8affefb7ac99732e11fa78466081d60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1736346Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683941}
parent 2e4873d6
...@@ -132,6 +132,8 @@ class V4L2ConfigStoreDecodeSurface : public V4L2DecodeSurface { ...@@ -132,6 +132,8 @@ class V4L2ConfigStoreDecodeSurface : public V4L2DecodeSurface {
// The configuration store of the input buffer. // The configuration store of the input buffer.
uint32_t config_store_; uint32_t config_store_;
DISALLOW_COPY_AND_ASSIGN(V4L2ConfigStoreDecodeSurface);
}; };
// An implementation of V4L2DecodeSurface that uses requests to associate // An implementation of V4L2DecodeSurface that uses requests to associate
...@@ -156,6 +158,8 @@ class V4L2RequestDecodeSurface : public V4L2DecodeSurface { ...@@ -156,6 +158,8 @@ class V4L2RequestDecodeSurface : public V4L2DecodeSurface {
bool Submit() const override; bool Submit() const override;
private: private:
~V4L2RequestDecodeSurface() override = default;
// FD of the request to use. // FD of the request to use.
const int request_fd_; const int request_fd_;
...@@ -167,6 +171,8 @@ class V4L2RequestDecodeSurface : public V4L2DecodeSurface { ...@@ -167,6 +171,8 @@ class V4L2RequestDecodeSurface : public V4L2DecodeSurface {
std::move(output_buffer), std::move(output_buffer),
std::move(frame)), std::move(frame)),
request_fd_(request_fd) {} request_fd_(request_fd) {}
DISALLOW_COPY_AND_ASSIGN(V4L2RequestDecodeSurface);
}; };
} // namespace media } // namespace media
......
...@@ -219,6 +219,9 @@ class V4L2BuffersList : public base::RefCountedThreadSafe<V4L2BuffersList> { ...@@ -219,6 +219,9 @@ class V4L2BuffersList : public base::RefCountedThreadSafe<V4L2BuffersList> {
size_t size() const; size_t size() const;
private: private:
friend class base::RefCountedThreadSafe<V4L2BuffersList>;
~V4L2BuffersList() = default;
mutable base::Lock lock_; mutable base::Lock lock_;
std::set<size_t> free_buffers_ GUARDED_BY(lock_); std::set<size_t> free_buffers_ GUARDED_BY(lock_);
DISALLOW_COPY_AND_ASSIGN(V4L2BuffersList); DISALLOW_COPY_AND_ASSIGN(V4L2BuffersList);
......
...@@ -68,6 +68,18 @@ bool IsValidFrameForQueueDMABuf(const VideoFrame* frame, ...@@ -68,6 +68,18 @@ bool IsValidFrameForQueueDMABuf(const VideoFrame* frame,
} // namespace } // namespace
V4L2SliceVideoDecoder::DecodeRequest::DecodeRequest(
scoped_refptr<DecoderBuffer> buf,
DecodeCB cb,
int32_t id)
: buffer(std::move(buf)), decode_cb(std::move(cb)), bitstream_id(id) {}
V4L2SliceVideoDecoder::DecodeRequest::DecodeRequest(DecodeRequest&&) = default;
V4L2SliceVideoDecoder::DecodeRequest& V4L2SliceVideoDecoder::DecodeRequest::
operator=(DecodeRequest&&) = default;
V4L2SliceVideoDecoder::DecodeRequest::~DecodeRequest() = default;
struct V4L2SliceVideoDecoder::OutputRequest { struct V4L2SliceVideoDecoder::OutputRequest {
enum OutputRequestType { enum OutputRequestType {
// The surface to be outputted. // The surface to be outputted.
......
...@@ -94,12 +94,13 @@ class MEDIA_GPU_EXPORT V4L2SliceVideoDecoder : public VideoDecoder, ...@@ -94,12 +94,13 @@ class MEDIA_GPU_EXPORT V4L2SliceVideoDecoder : public VideoDecoder,
// The identifier for the decoder buffer. // The identifier for the decoder buffer.
int32_t bitstream_id; int32_t bitstream_id;
DecodeRequest(scoped_refptr<DecoderBuffer> buf, DecodeCB cb, int32_t id) DecodeRequest(scoped_refptr<DecoderBuffer> buf, DecodeCB cb, int32_t id);
: buffer(std::move(buf)), decode_cb(std::move(cb)), bitstream_id(id) {}
// Allow move, but not copy // Allow move, but not copy
DecodeRequest(DecodeRequest&&) = default; DecodeRequest(DecodeRequest&&);
DecodeRequest& operator=(DecodeRequest&&) = default; DecodeRequest& operator=(DecodeRequest&&);
~DecodeRequest();
DISALLOW_COPY_AND_ASSIGN(DecodeRequest); DISALLOW_COPY_AND_ASSIGN(DecodeRequest);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment