You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					26 lines
				
				603 B
			
		
		
			
		
	
	
					26 lines
				
				603 B
			| 
								 
											4 years ago
										 
									 | 
							
								#pragma once
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <string>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#include <libavformat/avformat.h>
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								#include <libavcodec/avcodec.h>
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								#include "cereal/messaging/messaging.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								class VideoWriter {
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  VideoWriter(const char *path, const char *filename, bool remuxing, int width, int height, int fps, cereal::EncodeIndex::Type codec);
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  void write(uint8_t *data, int len, long long timestamp, bool codecconfig, bool keyframe);
							 | 
						||
| 
								 | 
							
								  ~VideoWriter();
							 | 
						||
| 
								 | 
							
								private:
							 | 
						||
| 
								 | 
							
								  std::string vid_path, lock_path;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  FILE *of = nullptr;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  AVCodecContext *codec_ctx;
							 | 
						||
| 
								 
											4 years ago
										 
									 | 
							
								  AVFormatContext *ofmt_ctx;
							 | 
						||
| 
								 | 
							
								  AVStream *out_stream;
							 | 
						||
| 
								 | 
							
								  bool remuxing, raw;
							 | 
						||
| 
								 | 
							
								};
							 |