Optimize build script

This commit is contained in:
dijunkun
2023-11-22 17:00:52 +08:00
parent c8d404ea7d
commit d79720532d
4 changed files with 98 additions and 85 deletions

View File

@@ -1,6 +1,12 @@
#ifndef _X_H_
#define _X_H_
#ifdef DLL_EXPORTS
#define DLLAPI __declspec(dllexport)
#else
#define DLLAPI __declspec(dllimport)
#endif
#include <stdint.h>
#include <stdlib.h>
@@ -34,20 +40,20 @@ typedef struct {
NetStatusReport net_status_report;
} Params;
PeerPtr* CreatePeer(const Params* params);
DLLAPI PeerPtr* CreatePeer(const Params* params);
int Init(PeerPtr* peer_ptr, const char* user_id);
DLLAPI int Init(PeerPtr* peer_ptr, const char* user_id);
int CreateConnection(PeerPtr* peer_ptr, const char* transmission_id,
const char* password);
DLLAPI int CreateConnection(PeerPtr* peer_ptr, const char* transmission_id,
const char* password);
int JoinConnection(PeerPtr* peer_ptr, const char* transmission_id,
const char* password);
DLLAPI int JoinConnection(PeerPtr* peer_ptr, const char* transmission_id,
const char* password);
int LeaveConnection(PeerPtr* peer_ptr);
DLLAPI int LeaveConnection(PeerPtr* peer_ptr);
int SendData(PeerPtr* peer_ptr, DATA_TYPE data_type, const char* data,
size_t size);
DLLAPI int SendData(PeerPtr* peer_ptr, DATA_TYPE data_type, const char* data,
size_t size);
#ifdef __cplusplus
}

View File

@@ -8,10 +8,10 @@
#define SAVE_H264_STREAM 0
#define YUV420P_BUFFER_SIZE 1280 * 720 * 3 / 2
unsigned char yuv420p_buffer[YUV420P_BUFFER_SIZE];
static unsigned char yuv420p_buffer[YUV420P_BUFFER_SIZE];
int NV12ToYUV420PFFmpeg(unsigned char *src_buffer, int width, int height,
unsigned char *dst_buffer) {
static int NV12ToYUV420PFFmpeg(unsigned char *src_buffer, int width, int height,
unsigned char *dst_buffer) {
AVFrame *Input_pFrame = av_frame_alloc();
AVFrame *Output_pFrame = av_frame_alloc();
struct SwsContext *img_convert_ctx = sws_getContext(

View File

@@ -23,10 +23,10 @@ extern "C" {
#define SAVE_H264_STREAM 0
#define YUV420P_BUFFER_SIZE 1280 * 720 * 3 / 2
unsigned char yuv420p_buffer[YUV420P_BUFFER_SIZE];
static unsigned char yuv420p_buffer[YUV420P_BUFFER_SIZE];
int NV12ToYUV420PFFmpeg(unsigned char *src_buffer, int width, int height,
unsigned char *dst_buffer) {
static int NV12ToYUV420PFFmpeg(unsigned char *src_buffer, int width, int height,
unsigned char *dst_buffer) {
AVFrame *Input_pFrame = av_frame_alloc();
AVFrame *Output_pFrame = av_frame_alloc();
struct SwsContext *img_convert_ctx = sws_getContext(