summaryrefslogtreecommitdiffstats
path: root/media/sfplugin/SkipCutBuffer.h
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-09-08 16:55:27 -0700
committerXin Li <delphij@google.com>2020-09-08 16:55:27 -0700
commit8db3722fae5cc87e64e458c0f82475a8e9740209 (patch)
treef7511c08fd7a0f5ed2dc2dd3e2b3f0170950a915 /media/sfplugin/SkipCutBuffer.h
parentdf55a29ab07825888e14188c6e3d2a4e743bf266 (diff)
parent9370cdfe57bdbb104e515378bf806434fcb112ad (diff)
downloadplatform_hardware_google_av-master.tar.gz
platform_hardware_google_av-master.tar.bz2
platform_hardware_google_av-master.zip
Merge Android RHEADmaster
Bug: 168057903 Merged-In: Ic45ea389825f0d8dd5480ff6845d940c9ec55a0a Change-Id: I469b04b384b08d932931b74fdc929f7603eb6fcb
Diffstat (limited to 'media/sfplugin/SkipCutBuffer.h')
-rw-r--r--media/sfplugin/SkipCutBuffer.h67
1 files changed, 0 insertions, 67 deletions
diff --git a/media/sfplugin/SkipCutBuffer.h b/media/sfplugin/SkipCutBuffer.h
deleted file mode 100644
index 0fb5690..0000000
--- a/media/sfplugin/SkipCutBuffer.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SKIP_CUT_BUFFER_H_
-
-#define SKIP_CUT_BUFFER_H_
-
-#include <media/MediaCodecBuffer.h>
-#include <media/stagefright/MediaBuffer.h>
-#include <media/stagefright/foundation/ABuffer.h>
-
-namespace android {
-
-/**
- * utility class to cut the start and end off a stream of data in MediaBuffers
- *
- */
-class SkipCutBuffer: public RefBase {
- public:
- // 'skip' is the number of frames to skip from the beginning
- // 'cut' is the number of frames to cut from the end
- // 'num16BitChannels' is the number of channels, which are assumed to be 16 bit wide each
- SkipCutBuffer(size_t skip, size_t cut, size_t num16Channels);
-
- // Submit one MediaBuffer for skipping and cutting. This may consume all or
- // some of the data in the buffer, or it may add data to it.
- // After this, the caller should continue processing the buffer as usual.
- void submit(MediaBuffer *buffer);
- void submit(const sp<ABuffer>& buffer); // same as above, but with an ABuffer
- void submit(const sp<MediaCodecBuffer>& buffer); // same as above, but with an ABuffer
- void clear();
- size_t size(); // how many bytes are currently stored in the buffer
-
- protected:
- virtual ~SkipCutBuffer();
-
- private:
- void write(const char *src, size_t num);
- size_t read(char *dst, size_t num);
- template <typename T>
- void submitInternal(const sp<T>& buffer);
- int32_t mSkip;
- int32_t mFrontPadding;
- int32_t mBackPadding;
- int32_t mWriteHead;
- int32_t mReadHead;
- int32_t mCapacity;
- char* mCutBuffer;
- DISALLOW_EVIL_CONSTRUCTORS(SkipCutBuffer);
-};
-
-} // namespace android
-
-#endif // OMX_CODEC_H_