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

Commit 091aa6d3 authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar
Browse files

Mark functions in MediaPlayerBase::AudioSink as pure virtual

Bug: http://b/116873221

Mark the functions in this class that aren't defined as pure virtual.
If not, Clang assumes that the TU which defines the first undefined
function will contain the vtable for the class as well.  Since there's
no out-of-line definition of this funciton, no TU ends up with the
vtable.

This causes a problem with coverage builds, which are built with -O0,
where calls don't get inlined, thereby requiring a definition of the
vtable.  For non -O0 builds, the vtable is not required since the
virtual calls get inlined/optimized-out.

Test: Build with and without coverage
Change-Id: I4644dcd892c5f47031f1603b0f809c1da95314db
parent b5d428af
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -151,13 +151,13 @@ public:

        virtual media::VolumeShaper::Status applyVolumeShaper(
                                    const sp<media::VolumeShaper::Configuration>& configuration,
                                    const sp<media::VolumeShaper::Operation>& operation);
        virtual sp<media::VolumeShaper::State> getVolumeShaperState(int id);
                                    const sp<media::VolumeShaper::Operation>& operation) = 0;
        virtual sp<media::VolumeShaper::State> getVolumeShaperState(int id) = 0;

        // AudioRouting
        virtual status_t    setOutputDevice(audio_port_handle_t deviceId);
        virtual status_t    getRoutedDeviceId(audio_port_handle_t* deviceId);
        virtual status_t    enableAudioDeviceCallback(bool enabled);
        virtual status_t    setOutputDevice(audio_port_handle_t deviceId) = 0;
        virtual status_t    getRoutedDeviceId(audio_port_handle_t* deviceId) = 0;
        virtual status_t    enableAudioDeviceCallback(bool enabled) = 0;
    };

                        MediaPlayerBase() {}