|  |  |  | @ -6,7 +6,12 @@ VideoEncoder::VideoEncoder(const EncoderInfo &encoder_info, int in_width, int in | 
			
		
	
		
			
				
					|  |  |  |  |   out_width = encoder_info.frame_width > 0 ? encoder_info.frame_width : in_width; | 
			
		
	
		
			
				
					|  |  |  |  |   out_height = encoder_info.frame_height > 0 ? encoder_info.frame_height : in_height; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   pm.reset(new PubMaster({encoder_info.publish_name})); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   std::vector pubs = {encoder_info.publish_name}; | 
			
		
	
		
			
				
					|  |  |  |  |   if (encoder_info.thumbnail_name != NULL) { | 
			
		
	
		
			
				
					|  |  |  |  |     pubs.push_back(encoder_info.thumbnail_name); | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  |   pm.reset(new PubMaster(pubs)); | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | void VideoEncoder::publisher_publish(VideoEncoder *e, int segment_num, uint32_t idx, VisionIpcBufExtra &extra, | 
			
		
	
	
		
			
				
					|  |  |  | @ -40,4 +45,15 @@ void VideoEncoder::publisher_publish(VideoEncoder *e, int segment_num, uint32_t | 
			
		
	
		
			
				
					|  |  |  |  |   kj::ArrayOutputStream output_stream(kj::ArrayPtr<capnp::byte>(e->msg_cache.data(), bytes_size)); | 
			
		
	
		
			
				
					|  |  |  |  |   capnp::writeMessage(output_stream, msg); | 
			
		
	
		
			
				
					|  |  |  |  |   e->pm->send(e->encoder_info.publish_name, e->msg_cache.data(), bytes_size); | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |   // Publish keyframe thumbnail
 | 
			
		
	
		
			
				
					|  |  |  |  |   if ((flags & V4L2_BUF_FLAG_KEYFRAME) && e->encoder_info.thumbnail_name != NULL) { | 
			
		
	
		
			
				
					|  |  |  |  |     MessageBuilder tm; | 
			
		
	
		
			
				
					|  |  |  |  |     auto thumbnail = tm.initEvent().initThumbnail(); | 
			
		
	
		
			
				
					|  |  |  |  |     thumbnail.setFrameId(extra.frame_id); | 
			
		
	
		
			
				
					|  |  |  |  |     thumbnail.setTimestampEof(extra.timestamp_eof); | 
			
		
	
		
			
				
					|  |  |  |  |     thumbnail.setThumbnail(dat); | 
			
		
	
		
			
				
					|  |  |  |  |     thumbnail.setEncoding(cereal::Thumbnail::Encoding::KEYFRAME); | 
			
		
	
		
			
				
					|  |  |  |  |     pm->send(e->encoder_info.thumbnail_name, tm); | 
			
		
	
		
			
				
					|  |  |  |  |   } | 
			
		
	
		
			
				
					|  |  |  |  | } |