#ifndef __COMMON_H__
#define __COMMON_H__

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <pthread.h>
#include <jpeglib.h>
#include "unify_protocol.h"

#define MAX_FILENAME_LENGTH 64
#define CHUNK_SIZE          4096

int init_udp_network(const char *target_ip, int target_port, struct sockaddr_in *dest_addr);
int parse_frame_size(dataType_e dataType, int width, int height, int filesize);
int read_jpeg_file(FILE *file, dataType_e dataType, uint8_t **rgb_data, int *width, int *height, int *fileSize);
int send_buffer(int sockfd, struct sockaddr_in *dest_addr, uint8_t *data, int size);

#endif
