Classes | Defines | Typedefs | Functions | Variables
fast-screen-capture.cpp File Reference
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <math.h>
#include <err.h>
#include <stdbool.h>
#include <sys/time.h>
#include <time.h>
#include <signal.h>
#include <termios.h>
#include <pthread.h>
#include <linux/input.h>
#include <sys/un.h>
#include <sys/socket.h>
#include "libcutils.h"
#include "libgui.h"
#include "libui.h"
#include "libskia.h"
#include "libstagefright.h"
Include dependency graph for fast-screen-capture.cpp:

Go to the source code of this file.

Classes

struct  ASC
struct  CallbackStep
struct  MyGraphicBufferProducer

Defines

#define ABORT(fmt, arg...)   ({_LOG(fmt ". Now exit", ##arg); exit(0);})
#define ABORT_ERRNO(fmt, arg...)   ({_LOG(fmt " [errno %d(%s)] Now exit", errno, strerror(errno), ##arg); exit(0);})
#define BPP   4
#define ENABLE_RESEND   1
#define getVirtFuncIndex(f)   _getVirtFuncIndex(0, f)
#define INIT_NEXT_CALLBACK_STEP(virtFuncName)
#define LOG(fmt, arg...)   ({static bool __logged=false; if (needLog||!__logged){_LOG("%s" fmt "%s", needLog?"":"--------rare case--------", ##arg, needLog?"":"\n\n");__logged=true;}})
#define LOGI(fmt, arg...)   LOG("--------" fmt "\n\n", ##arg)
#define max(a, b)   ((a) > (b) ? (a) : (b))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define MIN_DISP_INFO_HEAD_SIZE   0
#define MIN_DISP_INFO_SIZE   (MIN_DISP_INFO_HEAD_SIZE + ((size_t)&(((DisplayInfo*)NULL)->reserved)))
#define PVTBL_OF(inst)   (*((PVTBL*)(inst)))
#define RESEND_COUNT   2
#define RESEND_INTERVAL_NS   ((int)(1000000000*0.25))
#define toEvenInt(n)   ((int)(ceil(((float)(n))/2)*2))

Typedefs

typedef VADDRPVTBL
typedef void * VADDR

Functions

static int _getVirtFuncIndex (int dummy,...)
static void _LOG (const char *format,...)
void asc_capture (ASC *asc)
static void asc_create_virtual_display ()
static void asc_init (ASC *asc)
static int bpCodeToVirtIndex (uint32_t code)
static void bpInitCallbackSteps ()
static void chkDev ()
static int convertOrient (int orient)
static void create_cmd_socket_server ()
static void create_touch_socket_server ()
static int getOrient ()
static void setVirtDispOrient (int orient)
void sniffTransact (IBinder *binder)
static void * thread_cmd_socket_server (void *thd_param)
static void * thread_touch_socket_server (void *thd_param)

Variables

static sp< IBinder > __csBinder
static char * blackscreen = NULL
static int blackscreen_extra_count = 0
static MyGraphicBufferProducerbp
static int bpStepMax = 0
static CallbackStep bpSteps [1+32] = {0}
static int capture_h
static int capture_w
static Condition cond
static bool internal_w_gt_h = false
static bool isFirstTime = true
static bool isPaused = false
static bool isScreenOff = false
struct timespec lastRereadTime = {0}
static int logicalFrameSize
static sp< IBinder > mainDisp
static DisplayInfo mainDispInfo
static Mutex mutex
static bool needLog = true
struct timespec origTime = {0}
static int resend_count = 0
static uint32_t sniffered_transact_code = 0
static int step_queueBuffer = 0
static int step_requestBuffer = 0
static int touch_dev_fd = -1
static int TRANS_ID_GET_DISPLAY_INFO = 0
static int TRANS_ID_SET_DISPLAY_STATE = 0
static sp< IBinder > virtDisp
static DisplayState * virtDispState = new DisplayState()

Define Documentation

#define ABORT (   fmt,
  arg... 
)    ({_LOG(fmt ". Now exit", ##arg); exit(0);})

Definition at line 46 of file fast-screen-capture.cpp.

#define ABORT_ERRNO (   fmt,
  arg... 
)    ({_LOG(fmt " [errno %d(%s)] Now exit", errno, strerror(errno), ##arg); exit(0);})

Definition at line 47 of file fast-screen-capture.cpp.

#define BPP   4

Definition at line 334 of file fast-screen-capture.cpp.

#define ENABLE_RESEND   1

Definition at line 306 of file fast-screen-capture.cpp.

#define getVirtFuncIndex (   f)    _getVirtFuncIndex(0, f)

Definition at line 350 of file fast-screen-capture.cpp.

#define INIT_NEXT_CALLBACK_STEP (   virtFuncName)
Value:
({ \
    if (++bpStepMax >= sizeof(bpSteps)/sizeof(bpSteps[0])-1) ABORT("too many bpSteps"); \
    bpSteps[bpStepMax].ind = getVirtFuncIndex(&IGraphicBufferProducer::virtFuncName); \
    bpSteps[bpStepMax].name = #virtFuncName; \
})

Definition at line 360 of file fast-screen-capture.cpp.

#define LOG (   fmt,
  arg... 
)    ({static bool __logged=false; if (needLog||!__logged){_LOG("%s" fmt "%s", needLog?"":"--------rare case--------", ##arg, needLog?"":"\n\n");__logged=true;}})

Definition at line 44 of file fast-screen-capture.cpp.

#define LOGI (   fmt,
  arg... 
)    LOG("--------" fmt "\n\n", ##arg)

Definition at line 45 of file fast-screen-capture.cpp.

#define max (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 318 of file fast-screen-capture.cpp.

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 317 of file fast-screen-capture.cpp.

#define MIN_DISP_INFO_HEAD_SIZE   0

Definition at line 406 of file fast-screen-capture.cpp.

#define MIN_DISP_INFO_SIZE   (MIN_DISP_INFO_HEAD_SIZE + ((size_t)&(((DisplayInfo*)NULL)->reserved)))

Definition at line 408 of file fast-screen-capture.cpp.

#define PVTBL_OF (   inst)    (*((PVTBL*)(inst)))

Definition at line 349 of file fast-screen-capture.cpp.

#define RESEND_COUNT   2

Definition at line 313 of file fast-screen-capture.cpp.

#define RESEND_INTERVAL_NS   ((int)(1000000000*0.25))

Definition at line 312 of file fast-screen-capture.cpp.

#define toEvenInt (   n)    ((int)(ceil(((float)(n))/2)*2))

Definition at line 316 of file fast-screen-capture.cpp.


Typedef Documentation

typedef VADDR* PVTBL

Definition at line 348 of file fast-screen-capture.cpp.

typedef void* VADDR

Definition at line 347 of file fast-screen-capture.cpp.


Function Documentation

static int _getVirtFuncIndex ( int  dummy,
  ... 
) [static]

Definition at line 351 of file fast-screen-capture.cpp.

static void _LOG ( const char *  format,
  ... 
) [static]

Definition at line 49 of file fast-screen-capture.cpp.

void asc_capture ( ASC asc)

Definition at line 964 of file fast-screen-capture.cpp.

static void asc_create_virtual_display ( ) [static]

Definition at line 915 of file fast-screen-capture.cpp.

static void asc_init ( ASC asc) [static]

Definition at line 813 of file fast-screen-capture.cpp.

static int bpCodeToVirtIndex ( uint32_t  code) [static]

Definition at line 380 of file fast-screen-capture.cpp.

static void bpInitCallbackSteps ( ) [static]

Definition at line 366 of file fast-screen-capture.cpp.

static void chkDev ( ) [static]

Definition at line 77 of file fast-screen-capture.cpp.

static int convertOrient ( int  orient) [static]

Definition at line 388 of file fast-screen-capture.cpp.

static void create_cmd_socket_server ( ) [static]

Definition at line 219 of file fast-screen-capture.cpp.

static void create_touch_socket_server ( ) [static]

Definition at line 259 of file fast-screen-capture.cpp.

static int getOrient ( ) [static]

Definition at line 410 of file fast-screen-capture.cpp.

static void setVirtDispOrient ( int  orient) [static]

Definition at line 425 of file fast-screen-capture.cpp.

void sniffTransact ( IBinder *  binder)

Definition at line 764 of file fast-screen-capture.cpp.

static void* thread_cmd_socket_server ( void *  thd_param) [static]

Definition at line 136 of file fast-screen-capture.cpp.

static void* thread_touch_socket_server ( void *  thd_param) [static]

Definition at line 188 of file fast-screen-capture.cpp.


Variable Documentation

sp<IBinder> __csBinder [static]

Definition at line 320 of file fast-screen-capture.cpp.

char* blackscreen = NULL [static]

Definition at line 69 of file fast-screen-capture.cpp.

int blackscreen_extra_count = 0 [static]

Definition at line 70 of file fast-screen-capture.cpp.

Definition at line 326 of file fast-screen-capture.cpp.

int bpStepMax = 0 [static]

Definition at line 341 of file fast-screen-capture.cpp.

CallbackStep bpSteps[1+32] = {0} [static]

Definition at line 340 of file fast-screen-capture.cpp.

int capture_h [static]

Definition at line 325 of file fast-screen-capture.cpp.

int capture_w [static]

Definition at line 325 of file fast-screen-capture.cpp.

Condition cond [static]

Definition at line 73 of file fast-screen-capture.cpp.

bool internal_w_gt_h = false [static]

Definition at line 324 of file fast-screen-capture.cpp.

bool isFirstTime = true [static]

Definition at line 75 of file fast-screen-capture.cpp.

bool isPaused = false [static]

Definition at line 67 of file fast-screen-capture.cpp.

bool isScreenOff = false [static]

Definition at line 68 of file fast-screen-capture.cpp.

struct timespec lastRereadTime = {0}

Definition at line 310 of file fast-screen-capture.cpp.

int logicalFrameSize [static]

Definition at line 325 of file fast-screen-capture.cpp.

sp<IBinder> mainDisp [static]

Definition at line 322 of file fast-screen-capture.cpp.

DisplayInfo mainDispInfo [static]

Definition at line 323 of file fast-screen-capture.cpp.

Mutex mutex [static]

Definition at line 72 of file fast-screen-capture.cpp.

bool needLog = true [static]

Definition at line 43 of file fast-screen-capture.cpp.

struct timespec origTime = {0}

Definition at line 309 of file fast-screen-capture.cpp.

int resend_count = 0 [static]

Definition at line 311 of file fast-screen-capture.cpp.

uint32_t sniffered_transact_code = 0 [static]

Definition at line 762 of file fast-screen-capture.cpp.

int step_queueBuffer = 0 [static]

Definition at line 342 of file fast-screen-capture.cpp.

int step_requestBuffer = 0 [static]

Definition at line 343 of file fast-screen-capture.cpp.

int touch_dev_fd = -1 [static]

Definition at line 186 of file fast-screen-capture.cpp.

int TRANS_ID_GET_DISPLAY_INFO = 0 [static]

Definition at line 332 of file fast-screen-capture.cpp.

int TRANS_ID_SET_DISPLAY_STATE = 0 [static]

Definition at line 333 of file fast-screen-capture.cpp.

sp<IBinder> virtDisp [static]

Definition at line 322 of file fast-screen-capture.cpp.

DisplayState* virtDispState = new DisplayState() [static]

Definition at line 331 of file fast-screen-capture.cpp.



dji_ronin
Author(s):
autogenerated on Sat Jun 8 2019 20:15:31