Classes | Defines | Typedefs | Functions | Variables
fast-screen-capture2.cpp File Reference
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include <linux/fb.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 <pthread.h>
#include "libcutils.h"
#include "libgui.h"
#include "libui.h"
#include "libskia.h"
#include "libstagefright.h"
Include dependency graph for fast-screen-capture2.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   0
#define MIN_DISP_INFO_SIZE   (MIN_DISP_INFO_HEAD + ((size_t)&(((DisplayInfo*)NULL)->reserved)))
#define PVTBL_OF(inst)   (*((PVTBL*)(inst)))
#define RESEND_AFTER_NS   ((int)(1000000000*0.25-SEND_AFTER_NS))
#define SEND_AFTER_NS   0
#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 int convertOrient (int orient)
static int getOrient ()
static void setVirtDispOrient (int orient)
void sniffTransact (IBinder *binder)

Variables

static sp< IBinder > __csBinder
static bool alwaysRotate = false
static MyGraphicBufferProducerbp
static int bpStepMax = 0
static CallbackStep bpSteps [1+32] = {0}
static int capture_h
static int capture_w
static Condition cond
static Vector< sp< ABuffer > > ibfs
static bool isFirstTime = true
static struct timespec lastTime = {0}
static int logicalFrameSize
static sp< IBinder > mainDisp
static DisplayInfo mainDispInfo
static Mutex mutex
static bool needLog = true
static uint32_t sniffered_transact_code = 0
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 44 of file fast-screen-capture2.cpp.

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

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

#define BPP   4

Definition at line 102 of file fast-screen-capture2.cpp.

#define ENABLE_RESEND   1

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

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

Definition at line 120 of file fast-screen-capture2.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 130 of file fast-screen-capture2.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 42 of file fast-screen-capture2.cpp.

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

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

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

Definition at line 79 of file fast-screen-capture2.cpp.

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

Definition at line 78 of file fast-screen-capture2.cpp.

#define MIN_DISP_INFO_HEAD   0

Definition at line 163 of file fast-screen-capture2.cpp.

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

Definition at line 165 of file fast-screen-capture2.cpp.

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

Definition at line 119 of file fast-screen-capture2.cpp.

#define RESEND_AFTER_NS   ((int)(1000000000*0.25-SEND_AFTER_NS))

Definition at line 74 of file fast-screen-capture2.cpp.

#define SEND_AFTER_NS   0

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

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

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


Typedef Documentation

typedef VADDR* PVTBL

Definition at line 118 of file fast-screen-capture2.cpp.

typedef void* VADDR

Definition at line 117 of file fast-screen-capture2.cpp.


Function Documentation

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

Definition at line 121 of file fast-screen-capture2.cpp.

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

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

void asc_capture ( ASC asc)

Definition at line 683 of file fast-screen-capture2.cpp.

static void asc_create_virtual_display ( ) [static]

Definition at line 634 of file fast-screen-capture2.cpp.

static void asc_init ( ASC asc) [static]

Definition at line 550 of file fast-screen-capture2.cpp.

static int bpCodeToVirtIndex ( uint32_t  code) [static]

Definition at line 148 of file fast-screen-capture2.cpp.

static void bpInitCallbackSteps ( ) [static]

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

static int convertOrient ( int  orient) [static]

Definition at line 156 of file fast-screen-capture2.cpp.

static int getOrient ( ) [static]

Definition at line 167 of file fast-screen-capture2.cpp.

static void setVirtDispOrient ( int  orient) [static]

Definition at line 182 of file fast-screen-capture2.cpp.

void sniffTransact ( IBinder *  binder)

Definition at line 469 of file fast-screen-capture2.cpp.


Variable Documentation

sp<IBinder> __csBinder [static]

Definition at line 85 of file fast-screen-capture2.cpp.

bool alwaysRotate = false [static]

Definition at line 92 of file fast-screen-capture2.cpp.

Definition at line 90 of file fast-screen-capture2.cpp.

int bpStepMax = 0 [static]

Definition at line 113 of file fast-screen-capture2.cpp.

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

Definition at line 112 of file fast-screen-capture2.cpp.

int capture_h [static]

Definition at line 89 of file fast-screen-capture2.cpp.

int capture_w [static]

Definition at line 89 of file fast-screen-capture2.cpp.

Condition cond [static]

Definition at line 84 of file fast-screen-capture2.cpp.

Vector<sp<ABuffer> > ibfs [static]

Definition at line 100 of file fast-screen-capture2.cpp.

bool isFirstTime = true [static]

Definition at line 81 of file fast-screen-capture2.cpp.

struct timespec lastTime = {0} [static]

Definition at line 71 of file fast-screen-capture2.cpp.

int logicalFrameSize [static]

Definition at line 89 of file fast-screen-capture2.cpp.

sp<IBinder> mainDisp [static]

Definition at line 87 of file fast-screen-capture2.cpp.

DisplayInfo mainDispInfo [static]

Definition at line 88 of file fast-screen-capture2.cpp.

Mutex mutex [static]

Definition at line 83 of file fast-screen-capture2.cpp.

bool needLog = true [static]

Definition at line 82 of file fast-screen-capture2.cpp.

uint32_t sniffered_transact_code = 0 [static]

Definition at line 467 of file fast-screen-capture2.cpp.

int TRANS_ID_GET_DISPLAY_INFO = 0 [static]

Definition at line 97 of file fast-screen-capture2.cpp.

int TRANS_ID_SET_DISPLAY_STATE = 0 [static]

Definition at line 98 of file fast-screen-capture2.cpp.

sp<IBinder> virtDisp [static]

Definition at line 87 of file fast-screen-capture2.cpp.

DisplayState* virtDispState = new DisplayState() [static]

Definition at line 96 of file fast-screen-capture2.cpp.



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