Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86ed61a6 authored by Manisha Jajoo's avatar Manisha Jajoo
Browse files

MediaMuxer: Make MediaMuxer's default constructor as private

MediaMuxer now has a static create() method which adds required
argument validations on the input arguments and hence is now
preferred over default constructor.
Default constructor is now made private.

Bug: 146417874
Test: atest CtsMediaV2TestCases:MuxerTest
Test: atest CtsMediaV2TestCases:MuxerUnitTest
Test: CtsMediaMuxerTestCases

Change-Id: Id51f3110d7da4a723c2b6d5369bd6cc733018d72
parent c8c8ddea
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -56,10 +56,6 @@ public:
     */
    static MediaMuxer* create(int fd, OutputFormat format);

    // Construct the muxer with the file descriptor. Note that the MediaMuxer
    // will close this file at stop().
    MediaMuxer(int fd, OutputFormat format);

    virtual ~MediaMuxer();

    /**
@@ -135,6 +131,11 @@ public:
    sp<AMessage> getTrackFormat(size_t idx);

private:
    // Construct the muxer with the file descriptor. Note that the MediaMuxer
    // will close this file at stop().
    // This constructor is made private to ensure that MediaMuxer::create() is used instead.
    MediaMuxer(int fd, OutputFormat format);

    const OutputFormat mFormat;
    sp<MediaWriter> mWriter;
    Vector< sp<MediaAdapter> > mTrackList;  // Each track has its MediaAdapter.