mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[format]: format coding style
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@907 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -284,7 +284,7 @@ MPP_RET mpp_buffer_create(const char *tag, const char *caller, RK_U32 group_id,
|
||||
group->buffer_count++;
|
||||
group->count_unused++;
|
||||
|
||||
buffer_group_add_log(group, p, (group->mode == MPP_BUFFER_INTERNAL)?(BUF_CREATE):(BUF_COMMIT));
|
||||
buffer_group_add_log(group, p, (group->mode == MPP_BUFFER_INTERNAL) ? (BUF_CREATE) : (BUF_COMMIT));
|
||||
RET:
|
||||
MPP_BUF_FUNCTION_LEAVE();
|
||||
return ret;
|
||||
@@ -526,7 +526,7 @@ RK_U32 MppBufferService::get_group_id()
|
||||
{
|
||||
// avoid group_id reuse
|
||||
RK_U32 id = group_id++;
|
||||
while (get_group_by_id(group_id)){
|
||||
while (get_group_by_id(group_id)) {
|
||||
group_id++;
|
||||
}
|
||||
group_count++;
|
||||
|
@@ -77,15 +77,14 @@ typedef struct avsd_cur_strm_t {
|
||||
RK_U8 got_nalu_flag;
|
||||
} AvsdCurStream_t;
|
||||
|
||||
typedef struct avsd_nalu_t
|
||||
{
|
||||
typedef struct avsd_nalu_t {
|
||||
RK_U8 header;
|
||||
RK_U8 *pdata;
|
||||
RK_U32 size;
|
||||
RK_U32 length;
|
||||
RK_U8 start_pos;
|
||||
RK_U8 eof; //!< end of frame stream
|
||||
}AvsdNalu_t;
|
||||
} AvsdNalu_t;
|
||||
|
||||
//!< current parameters
|
||||
typedef struct avsd_cur_ctx_t {
|
||||
@@ -106,7 +105,7 @@ typedef struct avsd_video_ctx_t {
|
||||
struct avsd_input_ctx_t *p_inp;
|
||||
struct avsd_cur_ctx_t *p_cur;
|
||||
struct avs_dec_ctx_t *p_dec;
|
||||
}AvsdVideoCtx_t;
|
||||
} AvsdVideoCtx_t;
|
||||
|
||||
|
||||
typedef struct avsd_bitstream_t {
|
||||
@@ -114,11 +113,10 @@ typedef struct avsd_bitstream_t {
|
||||
RK_U32 size;
|
||||
RK_U32 len;
|
||||
RK_U32 offset; //!< start from the offset byte
|
||||
}AvsdBitstream_t;
|
||||
} AvsdBitstream_t;
|
||||
|
||||
|
||||
typedef struct avsd_outframe_t
|
||||
{
|
||||
typedef struct avsd_outframe_t {
|
||||
RK_S32 nWidth;
|
||||
RK_S32 nHeight;
|
||||
RK_U8 *data[4]; // Y U V data
|
||||
|
@@ -1341,8 +1341,7 @@ MPP_RET store_picture_in_dpb(H264_DpbBuf_t *p_Dpb, H264_StorePic_t *p)
|
||||
if ((min_poc - p_Dpb->last_output_poc) <= p_Dpb->poc_interval) {
|
||||
p_Dpb->last_output_poc = min_poc;
|
||||
FUN_CHECK(ret = write_stored_frame(p_Vid, p_Dpb->fs[min_pos]));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ typedef enum {
|
||||
PIC_ERR_FRAME = 0x3,
|
||||
PIC_ERR_WHOLE = 0x3,
|
||||
PIC_ERR_MAX,
|
||||
}PictureError;
|
||||
} PictureError;
|
||||
|
||||
typedef enum {
|
||||
FIELD_ORDER_NULL,
|
||||
@@ -125,7 +125,7 @@ typedef enum {
|
||||
FIELD_ORDER_BOT_FIRST,
|
||||
FIELD_ORDER_SAME,
|
||||
FIELD_ORDER_MAX
|
||||
}FieldOrder;
|
||||
} FieldOrder;
|
||||
//!< Field Coding Types
|
||||
typedef enum {
|
||||
FRAME_CODING = 0,
|
||||
|
@@ -462,8 +462,7 @@ static MPP_RET check_dpb_field_paired(H264_FrameStore_t *p_last, H264_StorePic_t
|
||||
|| (p_last->is_used == 2 && cur_structure == BOTTOM_FIELD) //!< Bot + Bot
|
||||
//|| ((!dec_pic->combine_flag) && p_last->is_used == 2 && cur_structure == TOP_FIELD) //!< Bot + Top + not combine
|
||||
|| ((!dec_pic->combine_flag) && p_last->is_used == 1 && cur_structure == BOTTOM_FIELD) //!< Top + Bot + not combine
|
||||
)
|
||||
{
|
||||
) {
|
||||
H264D_WARNNING("[check_field_paired] (discard) combine_flag=%d, last_used=%d, curr_struct=%d",
|
||||
dec_pic->combine_flag, p_last->is_used, cur_structure);
|
||||
return ret = MPP_NOK;
|
||||
|
@@ -107,7 +107,7 @@ static MPP_RET realloc_buffer(RK_U8 **buf, RK_U32 *max_size, RK_U32 add_size)
|
||||
{
|
||||
MPP_RET ret = MPP_ERR_UNKNOW;
|
||||
if ((*buf) == NULL) {
|
||||
H264D_ERR("[realloc_buffer] pointer is null, %p",(*buf));
|
||||
H264D_ERR("[realloc_buffer] pointer is null, %p", (*buf));
|
||||
ret = MPP_ERR_MALLOC;
|
||||
goto __FAILED;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ static MPP_RET realloc_buffer(RK_U8 **buf, RK_U32 *max_size, RK_U32 add_size)
|
||||
|
||||
(*buf) = mpp_realloc((*buf), RK_U8, ((*max_size) + add_size));
|
||||
if ((*buf) == NULL) {
|
||||
H264D_ERR("[realloc_buffer] max_size=%d, add_size=%d \n",(*max_size), add_size);
|
||||
H264D_ERR("[realloc_buffer] max_size=%d, add_size=%d \n", (*max_size), add_size);
|
||||
ret = MPP_ERR_MALLOC;
|
||||
goto __FAILED;
|
||||
}
|
||||
@@ -378,8 +378,7 @@ static MPP_RET store_cur_nalu(H264dCurCtx_t *p_Cur, H264dCurStream_t *p_strm, H2
|
||||
p_Inp->spspps_offset += p_strm->nalu_len + sizeof(g_start_precode);
|
||||
p_Inp->spspps_len = p_Inp->spspps_offset;
|
||||
}
|
||||
}
|
||||
else if ((p_strm->nalu_type == NALU_TYPE_SLICE)
|
||||
} else if ((p_strm->nalu_type == NALU_TYPE_SLICE)
|
||||
|| (p_strm->nalu_type == NALU_TYPE_IDR)) {
|
||||
p_Cur->p_Inp->spspps_update_flag = 1;
|
||||
p_Inp->spspps_offset = 0;
|
||||
@@ -497,8 +496,7 @@ MPP_RET fwrite_stream_to_file(H264dInputCtx_t *p_Inp, RK_U8 *pdata, RK_U32 len)
|
||||
p_Inp->fp = fopen(p_Inp->fname[global_file_fid], "wb");
|
||||
if (p_Inp->fp == NULL) {
|
||||
H264D_WARNNING("[open_stream_file] can not open stream file, %s", p_Inp->fname[global_file_fid]);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
fwrite(p_Inp->spspps_buf, sizeof(RK_U8), p_Inp->spspps_len, p_Inp->fp);
|
||||
fflush(p_Inp->fp);
|
||||
}
|
||||
@@ -960,15 +958,13 @@ MPP_RET parse_loop(H264_DecCtx_t *p_Dec)
|
||||
p_Dec->p_Vid->iNumOfSlicesDecoded++;
|
||||
if (p_Dec->is_parser_end) {
|
||||
p_Dec->next_state = SliceSTATE_RegisterOneFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
p_Dec->next_state = SliceSTATE_ResetSlice;
|
||||
}
|
||||
H264D_DBG(H264D_DBG_LOOP_STATE, "SliceSTATE_GetSliceData");
|
||||
break;
|
||||
case SliceSTATE_RegisterOneFrame:
|
||||
if (!p_Dec->is_parser_end){
|
||||
if (!p_Dec->is_parser_end) {
|
||||
ret = MPP_NOK;
|
||||
goto __FAILED;
|
||||
}
|
||||
|
@@ -428,14 +428,12 @@ MPP_RET process_slice(H264_SLICE_t *currSlice)
|
||||
p_Vid->structure = FRAME;
|
||||
currSlice->field_pic_flag = 0;
|
||||
currSlice->bottom_field_flag = 0;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
READ_ONEBIT(p_bitctx, &currSlice->field_pic_flag, "field_pic_flag");
|
||||
if (currSlice->field_pic_flag) {
|
||||
READ_ONEBIT(p_bitctx, &currSlice->bottom_field_flag, "field_pic_flag");
|
||||
p_Vid->structure = currSlice->bottom_field_flag ? BOTTOM_FIELD : TOP_FIELD;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
p_Vid->structure = FRAME;
|
||||
currSlice->bottom_field_flag = 0;
|
||||
}
|
||||
@@ -444,8 +442,7 @@ MPP_RET process_slice(H264_SLICE_t *currSlice)
|
||||
currSlice->mb_aff_frame_flag = (currSlice->active_sps->mb_adaptive_frame_field_flag && (currSlice->field_pic_flag == 0));
|
||||
if (currSlice->idr_flag) {
|
||||
READ_UE(p_bitctx, &currSlice->idr_pic_id, "idr_pic_id");
|
||||
}
|
||||
else if (currSlice->svc_extension_flag == 0 && currSlice->mvcExt.non_idr_flag == 0) {
|
||||
} else if (currSlice->svc_extension_flag == 0 && currSlice->mvcExt.non_idr_flag == 0) {
|
||||
READ_UE(p_bitctx, &currSlice->idr_pic_id, "idr_pic_id");
|
||||
}
|
||||
poc_used_bits = p_bitctx->used_bits; //!< init poc used bits
|
||||
@@ -454,8 +451,7 @@ MPP_RET process_slice(H264_SLICE_t *currSlice)
|
||||
if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1
|
||||
&& !currSlice->field_pic_flag) {
|
||||
READ_SE(p_bitctx, &currSlice->delta_pic_order_cnt_bottom, "delta_pic_order_cnt_bottom");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
currSlice->delta_pic_order_cnt_bottom = 0;
|
||||
}
|
||||
}
|
||||
@@ -465,12 +461,10 @@ MPP_RET process_slice(H264_SLICE_t *currSlice)
|
||||
|
||||
if (currSlice->p_Vid->active_pps->bottom_field_pic_order_in_frame_present_flag == 1 && !currSlice->field_pic_flag) {
|
||||
READ_SE(p_bitctx, &currSlice->delta_pic_order_cnt[1], "delta_pic_order_cnt[1]");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
currSlice->delta_pic_order_cnt[1] = 0; //!< set to zero if not in stream
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
currSlice->delta_pic_order_cnt[0] = 0;
|
||||
currSlice->delta_pic_order_cnt[1] = 0;
|
||||
}
|
||||
|
@@ -973,7 +973,7 @@ MPP_RET m2vd_decode_head(M2VDParserContext *ctx)
|
||||
|
||||
MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
|
||||
{
|
||||
RK_U32 pts = (RK_U32)(ctx->pts/1000);
|
||||
RK_U32 pts = (RK_U32)(ctx->pts / 1000);
|
||||
if (ctx->resetFlag && ctx->pic_head.picture_coding_type != M2VD_CODING_TYPE_I) {
|
||||
mpp_log("[m2v]: resetFlag[%d] && picture_coding_type[%d] != I_TYPE", ctx->resetFlag, ctx->pic_head.picture_coding_type);
|
||||
return MPP_NOK;
|
||||
@@ -1006,7 +1006,7 @@ MPP_RET m2vd_alloc_frame(M2VDParserContext *ctx)
|
||||
ctx->frame_period = tmp_frame_period;
|
||||
}
|
||||
}
|
||||
ctx->Group_start_Time =pts - (ctx->pic_head.temporal_reference * ctx->frame_period / 256);
|
||||
ctx->Group_start_Time = pts - (ctx->pic_head.temporal_reference * ctx->frame_period / 256);
|
||||
if (ctx->Group_start_Time < 0)
|
||||
ctx->Group_start_Time = 0;
|
||||
ctx->PreGetFrameTime = pts;
|
||||
|
@@ -185,7 +185,7 @@ static RK_U32 reset_dec_task(Mpp *mpp, DecTask *task)
|
||||
mpp_buf_slot_reset(frame_slots, task_dec->output);
|
||||
|
||||
}
|
||||
if(task->status.task_parsed_rdy){
|
||||
if (task->status.task_parsed_rdy) {
|
||||
mpp_log("task no send to hal que must clr current frame hal status");
|
||||
mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT);
|
||||
for (RK_U32 i = 0; i < MPP_ARRAY_ELEMS(task_dec->refer); i++) {
|
||||
@@ -316,14 +316,14 @@ static MPP_RET try_proc_dec_task(Mpp *mpp, DecTask *task)
|
||||
*
|
||||
*/
|
||||
if (!task->status.curr_task_rdy) {
|
||||
RK_S64 p_e, p_s,diff;
|
||||
RK_S64 p_e, p_s, diff;
|
||||
p_s = mpp_time();
|
||||
parser_prepare(dec->parser, dec->mpp_pkt_in, task_dec);
|
||||
p_e = mpp_time();
|
||||
if(mpp_debug & MPP_TIMING){
|
||||
diff = (p_e - p_s)/1000;
|
||||
if(diff > 15){
|
||||
mpp_log("waring mpp prepare stream consume %lld big than 15ms ",diff);
|
||||
if (mpp_debug & MPP_TIMING) {
|
||||
diff = (p_e - p_s) / 1000;
|
||||
if (diff > 15) {
|
||||
mpp_log("waring mpp prepare stream consume %lld big than 15ms ", diff);
|
||||
}
|
||||
}
|
||||
if (0 == mpp_packet_get_length(dec->mpp_pkt_in)) {
|
||||
@@ -619,7 +619,7 @@ void *mpp_dec_hal_thread(void *data)
|
||||
HalDecTask *task_dec = &task_info.dec;
|
||||
RK_S64 cur_deat = 0;
|
||||
RK_U64 dec_no = 0, total_time = 0;
|
||||
RK_S64 p_s,p_e;
|
||||
RK_S64 p_s, p_e;
|
||||
p_s = mpp_time();
|
||||
while (MPP_THREAD_RUNNING == hal->get_status()) {
|
||||
/*
|
||||
|
@@ -45,8 +45,7 @@
|
||||
|
||||
#define FPGA_TEST 0
|
||||
|
||||
const enum
|
||||
{
|
||||
const enum {
|
||||
H264ScalingList4x4Length = 16,
|
||||
H264ScalingList8x8Length = 64,
|
||||
} ScalingListLength;
|
||||
|
@@ -428,11 +428,11 @@ MPP_RET rkv_h264d_wait(void *hal, HalTaskInfo *task)
|
||||
RK_S32 wait_ret = -1;
|
||||
RK_S32 ret_len = 0, cur_deat = 0;
|
||||
VPU_CMD_TYPE ret_cmd = VPU_CMD_BUTT;
|
||||
RK_S64 p_s,p_e;
|
||||
RK_S64 p_s, p_e;
|
||||
p_s = mpp_time();
|
||||
wait_ret = VPUClientWaitResult(p_hal->vpu_socket, (RK_U32 *)p_hal->regs, DEC_RKV_REGISTERS, &ret_cmd, &ret_len);
|
||||
p_e = mpp_time();
|
||||
cur_deat = (p_e - p_s)/1000;
|
||||
cur_deat = (p_e - p_s) / 1000;
|
||||
p_hal->total_time += cur_deat;
|
||||
p_hal->iDecodedNum++;
|
||||
(void)wait_ret;
|
||||
|
@@ -617,7 +617,7 @@ MPP_RET vdpu_h264d_wait(void *hal, HalTaskInfo *task)
|
||||
RK_S32 wait_ret = -1;
|
||||
RK_S32 ret_len = 0, cur_deat = 0;
|
||||
VPU_CMD_TYPE ret_cmd = VPU_CMD_BUTT;
|
||||
RK_S64 p_s,p_e;
|
||||
RK_S64 p_s, p_e;
|
||||
p_s = mpp_time();
|
||||
wait_ret = VPUClientWaitResult(p_hal->vpu_socket, p_drv->p_reg, DEC_X170_REGISTERS, &ret_cmd, &ret_len);
|
||||
p_e = mpp_time();
|
||||
|
@@ -203,7 +203,8 @@ public:
|
||||
VpulibDlsym()
|
||||
: rkapi_hdl(NULL),
|
||||
rkvpu_open_cxt(NULL),
|
||||
rkvpu_close_cxt(NULL) {
|
||||
rkvpu_close_cxt(NULL)
|
||||
{
|
||||
if (!!access("/dev/rkvdec", F_OK)) {
|
||||
rkapi_hdl = dlopen("/system/lib/librk_on2.so", RTLD_LAZY);
|
||||
}
|
||||
@@ -219,7 +220,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
~VpulibDlsym() {
|
||||
~VpulibDlsym()
|
||||
{
|
||||
if (rkapi_hdl) {
|
||||
dlclose(rkapi_hdl);
|
||||
mpp_log("dlclose vpu lib");
|
||||
|
@@ -350,9 +350,9 @@ RK_S32 VpuApi::control(VpuCodecContext *ctx, VPU_API_CMD cmd, void *param)
|
||||
* 0 - 8bit
|
||||
* 1 - 10bit
|
||||
**/
|
||||
if(((p->ImgWidth&0x80000000)>>31)){
|
||||
p->ImgWidth = (p->ImgWidth&0x7FFFFFFF);
|
||||
ImgWidth = (p->ImgWidth *10)>>3;
|
||||
if (((p->ImgWidth & 0x80000000) >> 31)) {
|
||||
p->ImgWidth = (p->ImgWidth & 0x7FFFFFFF);
|
||||
ImgWidth = (p->ImgWidth * 10) >> 3;
|
||||
}
|
||||
if (ctx->videoCoding == OMX_RK_VIDEO_CodingHEVC) {
|
||||
p->ImgHorStride = hevc_ver_align_256_odd(ImgWidth);
|
||||
@@ -375,7 +375,7 @@ RK_S32 VpuApi::control(VpuCodecContext *ctx, VPU_API_CMD cmd, void *param)
|
||||
mpicmd = MPP_DEC_GET_STREAM_COUNT;
|
||||
break;
|
||||
}
|
||||
case VPU_API_GET_VPUMEM_USED_COUNT:{
|
||||
case VPU_API_GET_VPUMEM_USED_COUNT: {
|
||||
mpicmd = MPP_CODEC_GET_VPUMEM_USED_COUNT;
|
||||
break;
|
||||
}
|
||||
|
@@ -253,25 +253,21 @@ static MPP_RET avsd_input_init(InputParams *inp, RK_S32 ac, char *av[])
|
||||
mpp_log(" -o :[file] Set output YUV file.");
|
||||
mpp_log(" -n :[number] Set decoded frames.");
|
||||
CLcount += 1;
|
||||
}
|
||||
else if (!strncmp(av[CLcount], "-i", 2)) {
|
||||
} else if (!strncmp(av[CLcount], "-i", 2)) {
|
||||
strncpy(infile_name, av[CLcount + 1], strlen((const char*)av[CLcount + 1]) + 1);
|
||||
CLcount += 2;
|
||||
}
|
||||
else if (!strncmp(av[CLcount], "-n", 2)) {
|
||||
} else if (!strncmp(av[CLcount], "-n", 2)) {
|
||||
if (!sscanf(av[CLcount + 1], "%d", &inp->dec_num)) {
|
||||
goto __FAILED;
|
||||
}
|
||||
CLcount += 2;
|
||||
}
|
||||
else if (!strncmp(av[CLcount], "-o", 2)) {
|
||||
} else if (!strncmp(av[CLcount], "-o", 2)) {
|
||||
if (rkv_avsd_test_debug & AVSD_TEST_DUMPYUV) {
|
||||
inp->output_dec_pic = 1;
|
||||
strncpy(outfile_name, av[CLcount + 1], strlen((const char*)av[CLcount + 1]) + 1);
|
||||
}
|
||||
CLcount += 2;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
mpp_err("error, %s cannot explain command! \n", av[CLcount]);
|
||||
goto __FAILED;
|
||||
}
|
||||
@@ -292,7 +288,7 @@ static MPP_RET avsd_input_init(InputParams *inp, RK_S32 ac, char *av[])
|
||||
}
|
||||
|
||||
//!< malloc read buffer
|
||||
inp->bufsize = 30*1024;
|
||||
inp->bufsize = 30 * 1024;
|
||||
MEM_CHECK(ret, inp->pbuf = mpp_malloc(RK_U8, inp->bufsize));
|
||||
|
||||
AVSD_TEST_LOG(AVSD_TEST_TRACE, "------------------------------------------------------------");
|
||||
@@ -316,7 +312,7 @@ static MPP_RET avsd_read_data(InputParams *inp)
|
||||
inp->len = (RK_U32)fread(inp->pbuf, sizeof(RK_U8), inp->bufsize, inp->fp_in);
|
||||
inp->is_eof = feof(inp->fp_in);
|
||||
|
||||
if (inp->fp_read){
|
||||
if (inp->fp_read) {
|
||||
fwrite(inp->pbuf, inp->len, 1, inp->fp_read);
|
||||
fflush(inp->fp_read);
|
||||
}
|
||||
@@ -344,8 +340,7 @@ static MPP_RET decoder_single_test(AvsdTestCtx_t *pctx)
|
||||
(inp->dec_num && (inp->dec_no >= inp->dec_num))) {
|
||||
mpp_packet_init(&pkt, NULL, 0);
|
||||
mpp_packet_set_eos(pkt);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
FUN_CHECK(ret = avsd_read_data(inp));
|
||||
mpp_packet_init(&pkt, inp->pbuf, inp->len);
|
||||
}
|
||||
|
@@ -207,22 +207,26 @@ public:
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
void lock(MppThreadSignal id = THREAD_WORK) {
|
||||
void lock(MppThreadSignal id = THREAD_WORK)
|
||||
{
|
||||
mpp_assert(id < THREAD_SIGNAL_BUTT);
|
||||
mMutexCond[id].lock();
|
||||
}
|
||||
|
||||
void unlock(MppThreadSignal id = THREAD_WORK) {
|
||||
void unlock(MppThreadSignal id = THREAD_WORK)
|
||||
{
|
||||
mpp_assert(id < THREAD_SIGNAL_BUTT);
|
||||
mMutexCond[id].unlock();
|
||||
}
|
||||
|
||||
void wait(MppThreadSignal id = THREAD_WORK) {
|
||||
void wait(MppThreadSignal id = THREAD_WORK)
|
||||
{
|
||||
mpp_assert(id < THREAD_SIGNAL_BUTT);
|
||||
mMutexCond[id].wait();
|
||||
}
|
||||
|
||||
void signal(MppThreadSignal id = THREAD_WORK) {
|
||||
void signal(MppThreadSignal id = THREAD_WORK)
|
||||
{
|
||||
mpp_assert(id < THREAD_SIGNAL_BUTT);
|
||||
mMutexCond[id].signal();
|
||||
}
|
||||
|
@@ -95,16 +95,16 @@ void MppThread::stop()
|
||||
const DWORD MS_VC_EXCEPTION = 0x406D1388;
|
||||
|
||||
#pragma pack(push,8)
|
||||
typedef struct tagTHREADNAME_INFO
|
||||
{
|
||||
typedef struct tagTHREADNAME_INFO {
|
||||
DWORD dwType; // Must be 0x1000.
|
||||
LPCSTR szName; // Pointer to name (in user addr space).
|
||||
DWORD dwThreadID; // Thread ID (-1=caller thread).
|
||||
DWORD dwFlags; // Reserved for future use, must be zero.
|
||||
} THREADNAME_INFO;
|
||||
} THREADNAME_INFO;
|
||||
#pragma pack(pop)
|
||||
|
||||
void SetThreadName(DWORD dwThreadID, const char* threadName) {
|
||||
void SetThreadName(DWORD dwThreadID, const char* threadName)
|
||||
{
|
||||
THREADNAME_INFO info;
|
||||
info.dwType = 0x1000;
|
||||
info.szName = threadName;
|
||||
@@ -112,10 +112,9 @@ void SetThreadName(DWORD dwThreadID, const char* threadName) {
|
||||
info.dwFlags = 0;
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 6320 6322)
|
||||
__try{
|
||||
__try {
|
||||
RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER){
|
||||
} __except (EXCEPTION_EXECUTE_HANDLER) {
|
||||
}
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
Reference in New Issue
Block a user