simple_cdm_allocator.h 895 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_CDM_SIMPLE_CDM_ALLOCATOR_H_
  5. #define MEDIA_CDM_SIMPLE_CDM_ALLOCATOR_H_
  6. #include <stddef.h>
  7. #include <stdint.h>
  8. #include <memory>
  9. #include "media/cdm/cdm_allocator.h"
  10. namespace media {
  11. // This is a simple CdmAllocator for testing.
  12. class SimpleCdmAllocator final : public CdmAllocator {
  13. public:
  14. SimpleCdmAllocator();
  15. SimpleCdmAllocator(const SimpleCdmAllocator&) = delete;
  16. SimpleCdmAllocator& operator=(const SimpleCdmAllocator&) = delete;
  17. ~SimpleCdmAllocator() override;
  18. // CdmAllocator implementation.
  19. cdm::Buffer* CreateCdmBuffer(size_t capacity) override;
  20. std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() override;
  21. };
  22. } // namespace media
  23. #endif // MEDIA_CDM_SIMPLE_CDM_ALLOCATOR_H_