mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:32:45 +00:00 
			
		
		
		
	 213025f210
			
		
	
	
		213025f210
		
	
	
	
	
		
			
			That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
		
			
				
	
	
		
			44 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/ByteBuffer.h>
 | |
| #include <AK/Time.h>
 | |
| #include <LibVideo/Color/CodingIndependentCodePoints.h>
 | |
| 
 | |
| namespace Video {
 | |
| 
 | |
| class Sample {
 | |
| public:
 | |
|     virtual ~Sample() = default;
 | |
| 
 | |
|     virtual bool is_video_sample() const { return false; }
 | |
| };
 | |
| 
 | |
| class VideoSample : public Sample {
 | |
| public:
 | |
|     VideoSample(ReadonlyBytes data, CodingIndependentCodePoints container_cicp, Duration timestamp)
 | |
|         : m_data(data)
 | |
|         , m_container_cicp(container_cicp)
 | |
|         , m_timestamp(timestamp)
 | |
|     {
 | |
|     }
 | |
| 
 | |
|     bool is_video_sample() const override { return true; }
 | |
|     ReadonlyBytes const& data() const { return m_data; }
 | |
|     CodingIndependentCodePoints container_cicp() const { return m_container_cicp; }
 | |
|     Duration timestamp() const { return m_timestamp; }
 | |
| 
 | |
| private:
 | |
|     ReadonlyBytes m_data;
 | |
|     CodingIndependentCodePoints m_container_cicp;
 | |
|     Duration m_timestamp;
 | |
| };
 | |
| 
 | |
| // FIXME: Add samples for audio, subtitles, etc.
 | |
| 
 | |
| }
 |