| 
									
										
										
										
											2019-03-30 10:22:57 +00:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "rtp_generic.hh"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-22 09:43:35 +00:00
										 |  |  | namespace kvz_rtp { | 
					
						
							|  |  |  |     class connection; | 
					
						
							| 
									
										
										
										
											2019-08-12 06:25:17 +00:00
										 |  |  |     class reader; | 
					
						
							| 
									
										
										
										
											2019-05-22 09:43:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     namespace hevc { | 
					
						
							| 
									
										
										
										
											2019-07-30 05:33:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         enum FRAG_TYPES { | 
					
						
							|  |  |  |             FT_INVALID   = -2, /* invalid combination of S and E bits */ | 
					
						
							|  |  |  |             FT_NOT_FRAG  = -1, /* frame doesn't contain HEVC fragment */ | 
					
						
							|  |  |  |             FT_START     =  1, /* frame contains a fragment with S bit set */ | 
					
						
							|  |  |  |             FT_MIDDLE    =  2, /* frame is fragment but not S or E fragment */ | 
					
						
							|  |  |  |             FT_END       =  3, /* frame contains a fragment with E bit set */ | 
					
						
							|  |  |  |         }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-15 08:57:35 +00:00
										 |  |  |         rtp_error_t push_frame(kvz_rtp::connection *conn, uint8_t *data, size_t data_len); | 
					
						
							| 
									
										
										
										
											2019-06-03 08:58:53 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-30 05:33:21 +00:00
										 |  |  |         /* Inspect the type of "frame" and return its type to caller
 | 
					
						
							|  |  |  |          * | 
					
						
							|  |  |  |          * Return FT_START when a frame with an S-bit set is received | 
					
						
							|  |  |  |          * Return FT_MIDDLE when a frame with neither S nor E-bit set is received (aka middle frag) | 
					
						
							|  |  |  |          * Return FT_END when a frame with E-bit set is received | 
					
						
							|  |  |  |          * Return FT_INVALID if the fragment contains invalid data | 
					
						
							|  |  |  |          * Return FT_NOT_FRAG if the frame doesn't contain HEVC fragment | 
					
						
							|  |  |  |          * | 
					
						
							|  |  |  |          * Return RTP_OK when E bit of the NAL header is set */ | 
					
						
							|  |  |  |         int check_frame(kvz_rtp::frame::rtp_frame *frame); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 06:25:17 +00:00
										 |  |  |         /* TODO:  */ | 
					
						
							|  |  |  |         /* rtp_error_t frame_receiver(kvz_rtp::reader *reader); */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         rtp_error_t frame_receiver(kvz_rtp::reader *reader); | 
					
						
							| 
									
										
										
										
											2019-05-22 09:43:35 +00:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2019-03-30 10:22:57 +00:00
										 |  |  | }; |