FFmpeg源代碼簡單分析-其他-libavdevice的gdigrab

參考鏈接

  • FFmpeg源代碼簡單分析:libavdevice的gdigrab_雷霄驊的博客-CSDN博客_gdigrab

libavdevice的gdigrab

  • GDIGrab用于在Windows下屏幕錄像(抓屏)
  • gdigrab的源代碼位于libavdevice\gdigrab.c。
  • 關鍵函數的調用關系圖如下圖所示。
  • 圖中綠色背景的函數代表源代碼中自己聲明的函數,紫色背景的函數代表Win32的API函數。

?

ff_gdigrab_demuxer

  • 在FFmpeg中Device也被當做是一種Format,因為GDIGrab是一個輸入設備,因此被當作一個AVInputFormat。
  • GDIGrab對應的AVInputFormat結構體如下所示。
/** gdi grabber device demuxer declaration */
const AVInputFormat ff_gdigrab_demuxer = {.name           = "gdigrab",.long_name      = NULL_IF_CONFIG_SMALL("GDI API Windows frame grabber"),.priv_data_size = sizeof(struct gdigrab),.read_header    = gdigrab_read_header,.read_packet    = gdigrab_read_packet,.read_close     = gdigrab_read_close,.flags          = AVFMT_NOFILE,.priv_class     = &gdigrab_class,
};
  • 從該結構體可以看出:
    • 設備名稱是“gdigrab”;
    • 設備完整名稱是“GDI API Windows frame grabber”;
    • 初始化函數指針read_header()指向gdigrab_read_header();
    • 讀取數據函數指針read_packet()指向gdigrab_read_packet();
    • 關閉函數指針read_close()指向gdigrab_read_close();
    • Flags設置為AVFMT_NOFILE;
    • AVClass指定為gdigrab_class。
  • 下面分析一下這些數據。

gdigrab_class

  • ff_gdigrab_demuxer指定它的AVClass為一個名稱為“gdigrab_class”的靜態變量。
  • gdigrab_class的定義如下。
static const AVClass gdigrab_class = {.class_name = "GDIgrab indev",.item_name  = av_default_item_name,.option     = options,.version    = LIBAVUTIL_VERSION_INT,.category   = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
};
  • 從gdigrab_class的定義可以看出,它指定了一個名稱為“options”的數組作為它的選項數組(賦值給AVClass的option變量)

options

  • 下面看一下這個options數組的定義,如下所示。
#define OFFSET(x) offsetof(struct gdigrab, x)
#define DEC AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {{ "draw_mouse", "draw the mouse pointer", OFFSET(draw_mouse), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },{ "show_region", "draw border around capture area", OFFSET(show_region), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },{ "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, INT_MAX, DEC },{ "video_size", "set video frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },{ "offset_x", "capture area x offset", OFFSET(offset_x), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },{ "offset_y", "capture area y offset", OFFSET(offset_y), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC },{ NULL },
};
  • options數組中包含了該Device支持的選項。可以看出GDIGrab支持如下選項:
    • draw_mouse:畫出鼠標指針。
    • show_region:劃出抓屏區域的邊界。
    • framerate:抓屏幀率。
    • video_size:抓屏的大小。
    • offset_x:抓屏起始點x軸坐標。
    • offset_y:抓屏起始點y軸坐標。
  • 從宏定義“#define OFFSET(x) offsetof(struct gdigrab, x)”中可以看出,這些選項都存儲在一個名稱為“gdigrab”的結構體中。

Gdigrab 上下文結構體

  • Gdigrab上下文結構體中存儲了GDIGrab設備用到的各種變量,定義如下所示。
/*** GDI Device Demuxer context*/
struct gdigrab {const AVClass *class;   /**< Class for private options */int        frame_size;  /**< Size in bytes of the frame pixel data */int        header_size; /**< Size in bytes of the DIB header */AVRational time_base;   /**< Time base */int64_t    time_frame;  /**< Current time */int        draw_mouse;  /**< Draw mouse cursor (private option) */int        show_region; /**< Draw border (private option) */AVRational framerate;   /**< Capture framerate (private option) */int        width;       /**< Width of the grab frame (private option) */int        height;      /**< Height of the grab frame (private option) */int        offset_x;    /**< Capture x offset (private option) */int        offset_y;    /**< Capture y offset (private option) */HWND       hwnd;        /**< Handle of the window for the grab */HDC        source_hdc;  /**< Source device context */HDC        dest_hdc;    /**< Destination, source-compatible DC */BITMAPINFO bmi;         /**< Information describing DIB format */HBITMAP    hbmp;        /**< Information on the bitmap captured */void      *buffer;      /**< The buffer containing the bitmap image data */RECT       clip_rect;   /**< The subarea of the screen or window to clip */HWND       region_hwnd; /**< Handle of the region border window */int cursor_error_printed;
};

gdigrab_read_header()

  • gdigrab_read_header()用于初始化gdigrab。
  • 函數的定義如下所示。
/*** Initializes the gdi grab device demuxer (public device demuxer API).** @param s1 Context from avformat core* @return AVERROR_IO error, 0 success*/
static int
gdigrab_read_header(AVFormatContext *s1)
{struct gdigrab *gdigrab = s1->priv_data;HWND hwnd;HDC source_hdc = NULL;HDC dest_hdc   = NULL;BITMAPINFO bmi;HBITMAP hbmp   = NULL;void *buffer   = NULL;const char *filename = s1->url;const char *name     = NULL;AVStream   *st       = NULL;int bpp;int horzres;int vertres;int desktophorzres;int desktopvertres;RECT virtual_rect;RECT clip_rect;BITMAP bmp;int ret;if (!strncmp(filename, "title=", 6)) {wchar_t *name_w = NULL;name = filename + 6;if(utf8towchar(name, &name_w)) {ret = AVERROR(errno);goto error;}if(!name_w) {ret = AVERROR(EINVAL);goto error;}hwnd = FindWindowW(NULL, name_w);av_freep(&name_w);if (!hwnd) {av_log(s1, AV_LOG_ERROR,"Can't find window '%s', aborting.\n", name);ret = AVERROR(EIO);goto error;}if (gdigrab->show_region) {av_log(s1, AV_LOG_WARNING,"Can't show region when grabbing a window.\n");gdigrab->show_region = 0;}} else if (!strcmp(filename, "desktop")) {hwnd = NULL;} else {av_log(s1, AV_LOG_ERROR,"Please use \"desktop\" or \"title=<windowname>\" to specify your target.\n");ret = AVERROR(EIO);goto error;}/* This will get the device context for the selected window, or if* none, the primary screen */source_hdc = GetDC(hwnd);if (!source_hdc) {WIN32_API_ERROR("Couldn't get window device context");ret = AVERROR(EIO);goto error;}bpp = GetDeviceCaps(source_hdc, BITSPIXEL);horzres = GetDeviceCaps(source_hdc, HORZRES);vertres = GetDeviceCaps(source_hdc, VERTRES);desktophorzres = GetDeviceCaps(source_hdc, DESKTOPHORZRES);desktopvertres = GetDeviceCaps(source_hdc, DESKTOPVERTRES);if (hwnd) {GetClientRect(hwnd, &virtual_rect);/* window -- get the right height and width for scaling DPI */virtual_rect.left   = virtual_rect.left   * desktophorzres / horzres;virtual_rect.right  = virtual_rect.right  * desktophorzres / horzres;virtual_rect.top    = virtual_rect.top    * desktopvertres / vertres;virtual_rect.bottom = virtual_rect.bottom * desktopvertres / vertres;} else {/* desktop -- get the right height and width for scaling DPI */virtual_rect.left = GetSystemMetrics(SM_XVIRTUALSCREEN);virtual_rect.top = GetSystemMetrics(SM_YVIRTUALSCREEN);virtual_rect.right = (virtual_rect.left + GetSystemMetrics(SM_CXVIRTUALSCREEN)) * desktophorzres / horzres;virtual_rect.bottom = (virtual_rect.top + GetSystemMetrics(SM_CYVIRTUALSCREEN)) * desktopvertres / vertres;}/* If no width or height set, use full screen/window area */if (!gdigrab->width || !gdigrab->height) {clip_rect.left = virtual_rect.left;clip_rect.top = virtual_rect.top;clip_rect.right = virtual_rect.right;clip_rect.bottom = virtual_rect.bottom;} else {clip_rect.left = gdigrab->offset_x;clip_rect.top = gdigrab->offset_y;clip_rect.right = gdigrab->width + gdigrab->offset_x;clip_rect.bottom = gdigrab->height + gdigrab->offset_y;}if (clip_rect.left < virtual_rect.left ||clip_rect.top < virtual_rect.top ||clip_rect.right > virtual_rect.right ||clip_rect.bottom > virtual_rect.bottom) {av_log(s1, AV_LOG_ERROR,"Capture area (%li,%li),(%li,%li) extends outside window area (%li,%li),(%li,%li)",clip_rect.left, clip_rect.top,clip_rect.right, clip_rect.bottom,virtual_rect.left, virtual_rect.top,virtual_rect.right, virtual_rect.bottom);ret = AVERROR(EIO);goto error;}if (name) {av_log(s1, AV_LOG_INFO,"Found window %s, capturing %lix%lix%i at (%li,%li)\n",name,clip_rect.right - clip_rect.left,clip_rect.bottom - clip_rect.top,bpp, clip_rect.left, clip_rect.top);} else {av_log(s1, AV_LOG_INFO,"Capturing whole desktop as %lix%lix%i at (%li,%li)\n",clip_rect.right - clip_rect.left,clip_rect.bottom - clip_rect.top,bpp, clip_rect.left, clip_rect.top);}if (clip_rect.right - clip_rect.left <= 0 ||clip_rect.bottom - clip_rect.top <= 0 || bpp%8) {av_log(s1, AV_LOG_ERROR, "Invalid properties, aborting\n");ret = AVERROR(EIO);goto error;}dest_hdc = CreateCompatibleDC(source_hdc);if (!dest_hdc) {WIN32_API_ERROR("Screen DC CreateCompatibleDC");ret = AVERROR(EIO);goto error;}/* Create a DIB and select it into the dest_hdc */bmi.bmiHeader.biSize          = sizeof(BITMAPINFOHEADER);bmi.bmiHeader.biWidth         = clip_rect.right - clip_rect.left;bmi.bmiHeader.biHeight        = -(clip_rect.bottom - clip_rect.top);bmi.bmiHeader.biPlanes        = 1;bmi.bmiHeader.biBitCount      = bpp;bmi.bmiHeader.biCompression   = BI_RGB;bmi.bmiHeader.biSizeImage     = 0;bmi.bmiHeader.biXPelsPerMeter = 0;bmi.bmiHeader.biYPelsPerMeter = 0;bmi.bmiHeader.biClrUsed       = 0;bmi.bmiHeader.biClrImportant  = 0;hbmp = CreateDIBSection(dest_hdc, &bmi, DIB_RGB_COLORS,&buffer, NULL, 0);if (!hbmp) {WIN32_API_ERROR("Creating DIB Section");ret = AVERROR(EIO);goto error;}if (!SelectObject(dest_hdc, hbmp)) {WIN32_API_ERROR("SelectObject");ret = AVERROR(EIO);goto error;}/* Get info from the bitmap */GetObject(hbmp, sizeof(BITMAP), &bmp);st = avformat_new_stream(s1, NULL);if (!st) {ret = AVERROR(ENOMEM);goto error;}avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */gdigrab->frame_size  = bmp.bmWidthBytes * bmp.bmHeight * bmp.bmPlanes;gdigrab->header_size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) +(bpp <= 8 ? (1 << bpp) : 0) * sizeof(RGBQUAD) /* palette size */;gdigrab->time_base   = av_inv_q(gdigrab->framerate);gdigrab->time_frame  = av_gettime_relative() / av_q2d(gdigrab->time_base);gdigrab->hwnd       = hwnd;gdigrab->source_hdc = source_hdc;gdigrab->dest_hdc   = dest_hdc;gdigrab->hbmp       = hbmp;gdigrab->bmi        = bmi;gdigrab->buffer     = buffer;gdigrab->clip_rect  = clip_rect;gdigrab->cursor_error_printed = 0;if (gdigrab->show_region) {if (gdigrab_region_wnd_init(s1, gdigrab)) {ret = AVERROR(EIO);goto error;}}st->avg_frame_rate = av_inv_q(gdigrab->time_base);st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;st->codecpar->codec_id   = AV_CODEC_ID_BMP;st->codecpar->bit_rate   = (gdigrab->header_size + gdigrab->frame_size) * 1/av_q2d(gdigrab->time_base) * 8;return 0;error:if (source_hdc)ReleaseDC(hwnd, source_hdc);if (dest_hdc)DeleteDC(dest_hdc);if (hbmp)DeleteObject(hbmp);if (source_hdc)DeleteDC(source_hdc);return ret;
}
  • 從源代碼可以看出,gdigrab_read_header()的流程大致如下所示:
    • (1)確定窗口的句柄hwnd。如果指定了“title=”的話,調用FindWindow()獲取hwnd;如果指定了“desktop”,則設定hwnd為NULL。
    • (2)根據窗口的句柄hwnd確定抓屏的矩形區域。如果抓取指定窗口,則通過GetClientRect()函數;否則就抓取整個屏幕。
    • (3)調用GDI的API完成抓屏的一些初始化工作。包括:
      • a)通過GetDC()獲得某個窗口句柄的HDC(在這里是source_hdc)。
      • b)通過CreateCompatibleDC()創建一個與指定設備兼容的HDC(在這里是dest_hdc)
      • c)通過CreateDIBSection()創建HBITMAP
      • d)通過SelectObject()綁定HBITMAP和HDC(指的是dest_hdc)
  • (4)通過avformat_new_stream()創建一個AVStream。
  • (5)將初始化時候的一些參數保存至GDIGrab的上下文結構體。

gdigrab_read_packet()

  • gdigrab_read_packet()用于讀取一幀抓屏數據。
  • 該函數的定義如下所示。
/*** Grabs a frame from gdi (public device demuxer API).** @param s1 Context from avformat core* @param pkt Packet holding the grabbed frame* @return frame size in bytes*/
static int gdigrab_read_packet(AVFormatContext *s1, AVPacket *pkt)
{struct gdigrab *gdigrab = s1->priv_data;//讀取參數HDC        dest_hdc   = gdigrab->dest_hdc;HDC        source_hdc = gdigrab->source_hdc;RECT       clip_rect  = gdigrab->clip_rect;AVRational time_base  = gdigrab->time_base;int64_t    time_frame = gdigrab->time_frame;BITMAPFILEHEADER bfh;int file_size = gdigrab->header_size + gdigrab->frame_size;int64_t curtime, delay;/* Calculate the time of the next frame */time_frame += INT64_C(1000000);/* Run Window message processing queue */if (gdigrab->show_region)gdigrab_region_wnd_update(s1, gdigrab);/* wait based on the frame rate *///延時for (;;) {curtime = av_gettime();delay = time_frame * av_q2d(time_base) - curtime;if (delay <= 0) {if (delay < INT64_C(-1000000) * av_q2d(time_base)) {time_frame += INT64_C(1000000);}break;}if (s1->flags & AVFMT_FLAG_NONBLOCK) {return AVERROR(EAGAIN);} else {av_usleep(delay);}}//新建一個AVPacketif (av_new_packet(pkt, file_size) < 0)return AVERROR(ENOMEM);pkt->pts = curtime;/* Blit screen grab *///關鍵:BitBlt()完成抓屏功能if (!BitBlt(dest_hdc, 0, 0,clip_rect.right - clip_rect.left,clip_rect.bottom - clip_rect.top,source_hdc,clip_rect.left, clip_rect.top, SRCCOPY | CAPTUREBLT)) {WIN32_API_ERROR("Failed to capture image");return AVERROR(EIO);}//畫鼠標指針?if (gdigrab->draw_mouse)paint_mouse_pointer(s1, gdigrab);/* Copy bits to packet data *///BMP文件頭BITMAPFILEHEADERbfh.bfType = 0x4d42; /* "BM" in little-endian */bfh.bfSize = file_size;bfh.bfReserved1 = 0;bfh.bfReserved2 = 0;bfh.bfOffBits = gdigrab->header_size;//往AVPacket中拷貝數據//拷貝BITMAPFILEHEADERmemcpy(pkt->data, &bfh, sizeof(bfh));//拷貝BITMAPINFOHEADERmemcpy(pkt->data + sizeof(bfh), &gdigrab->bmi.bmiHeader, sizeof(gdigrab->bmi.bmiHeader));//不常見if (gdigrab->bmi.bmiHeader.biBitCount <= 8)GetDIBColorTable(dest_hdc, 0, 1 << gdigrab->bmi.bmiHeader.biBitCount,(RGBQUAD *) (pkt->data + sizeof(bfh) + sizeof(gdigrab->bmi.bmiHeader)));//拷貝像素數據memcpy(pkt->data + gdigrab->header_size, gdigrab->buffer, gdigrab->frame_size);gdigrab->time_frame = time_frame;return gdigrab->header_size + gdigrab->frame_size;
}
  • 從源代碼可以看出,gdigrab_read_packet()的流程大致如下所示:
  • (1)從GDIGrab上下文結構體讀取初始化時候設定的參數。
  • (2)根據幀率參數進行延時。
  • (3)通過av_new_packet()新建一個AVPacket。
  • (4)通過BitBlt()完成抓屏功能。
  • (5)如果需要畫鼠標指針的話,調用paint_mouse_pointer(),這里不做分析。
  • (6)按照順序拷貝以下3項內容至AVPacket的data指向的內存:
    • a)BITMAPFILEHEADER
    • b)BITMAPINFOHEADER
    • c)抓屏的到的像素數據

gdigrab_read_close()

  • gdigrab_read_close()用于關閉gdigrab。
  • 該函數的定義如下所示。
  • 從源代碼可以看出,gdigrab_read_close ()完成了各種變量的清理工作。
/*** Closes gdi frame grabber (public device demuxer API).** @param s1 Context from avformat core* @return 0 success, !0 failure*/
static int gdigrab_read_close(AVFormatContext *s1)
{struct gdigrab *s = s1->priv_data;if (s->show_region)gdigrab_region_wnd_destroy(s1, s);if (s->source_hdc)ReleaseDC(s->hwnd, s->source_hdc);if (s->dest_hdc)DeleteDC(s->dest_hdc);if (s->hbmp)DeleteObject(s->hbmp);if (s->source_hdc)DeleteDC(s->source_hdc);return 0;
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/445919.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/445919.shtml
英文地址,請注明出處:http://en.pswp.cn/news/445919.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

分區和分片的區別_PHP: 分區和分片 - Manual

分區和分片數據庫群組是由于各種各樣的原因建立的&#xff0c;他可以提升處理能力、容忍錯誤&#xff0c;并且提升大量服務器同時工作的的性能。群組有時會組合分區和共享功能&#xff0c;來將大量復雜的任務分拆成更加簡單的任務&#xff0c;更加可控的單元。插件可以支持各種…

Ubuntu安裝GmSSL庫適用于ubuntu18和ubuntu20版本

參考鏈接 編譯與安裝【GmSSL】GmSSL 與 OpenSSL 共存的安裝方法_阿卡基YUAN的博客-CSDN博客_openssl和gmssl在Linux下安裝GmSSL_百里楊的博客-CSDN博客_安裝gmssl ubuntu18操作 需要超級管理員權限本人將下載的安裝包master.zip和安裝的位置都設定在/usr/local下創建文件夾/u…

Windows7右鍵菜單欄添加打開cmd項

背景簡介 眾所周知&#xff0c;在Linux桌面操作系統中的工作目錄窗口中&#xff0c;單擊鼠標右鍵&#xff0c;彈出的菜單欄通常有一項“打開終端”&#xff0c;然后移動鼠標點擊該項&#xff0c;就可以打開Shell窗口&#xff0c;在當前工作目錄進行命令行操作。 但是&#xf…

python11_Python11,文件操作

整了這么多雜七雜八又“沒用”的&#xff0c;終于來點實際的操作了。Python中用open()方法來對打開文件。我們來看看它的用法&#xff1a;path "C:\\Users\Frank\Desktop\\text.txt"f open(path,r,encoding"utf-8")首先給變量path指定一個路徑&#xff0…

在ubuntu環境下執行openssl編譯和安裝

參考鏈接 工具系列 | Ubuntu18.04安裝Openssl-1.1.1_Tinywan的技術博客_51CTO博客密碼學專題 openssl編譯和安裝_MY CUP OF TEA的博客-CSDN博客_openssl 編譯安裝 下載 /source/index.html編譯 使用命令sudo tar -xvzf openssl-1.1.1q.tar.gz 解壓。使用cd openssl-1.1.1q/進…

chrome 使用gpu 加速_一招解決 Chrome / Edge 卡頓緩慢 讓瀏覽器重回流暢順滑

最近一段時間,我發現電腦上的 Chrome 谷歌瀏覽器越用越卡了。特別是網頁打開比較多,同時還有視頻播放時,整個瀏覽器的響應速度都會變得非常緩慢,視頻也會卡頓掉幀。 我用的是 iMac / 32GB 內存 / Intel 四核 i7 4Ghz CPU,硬件性能應該足以讓 Chrome 流暢打開幾十個網頁標簽…

CLion運行程序時添加命令行參數 即設置argv輸入參數

參考鏈接 CLion運行程序時添加命令行參數_三豐雜貨鋪的博客-CSDN博客_clion命令行參數 操作流程 Run -> Edit -> Configuration -> Program arguments那里添內容最快捷的方式是&#xff0c;點擊錘子編譯圖標和運行圖標之間的的圖標&#xff0c;進行Edit Configurati…

python的userlist_Python Collections.UserList用法及代碼示例

Python列表是array-like數據結構&#xff0c;但與之不同的是它是同質的。單個列表可能包含數據類型&#xff0c;例如整數&#xff0c;字符串以及對象。 Python中的列表是有序的&#xff0c;并且有一定數量。根據確定的序列對列表中的元素進行索引&#xff0c;并使用0作為第一個…

解決 SSL_CTX_use_certificate:ca md too weak:ssl/ssl_rsa.c 問題

報錯原因分析 原因是openssl調整了安全級別&#xff0c;要求ca具備更高等級的安全&#xff0c;因此先前發布的證書&#xff0c;如果采用了不安全的算法&#xff0c;比如MD5&#xff0c;就會顯示上述這個錯誤 解決辦法 重新生成證書&#xff0c;先前證書棄用使用函數 SSL_CTX_…

向上滾動 終端_ubuntu

Ubuntu終端Terminal常用快捷鍵Ubuntu終端Terminal常用快捷鍵 快捷鍵 功能 Tab 自動補全 Ctrla 光標移動到開始位置 Ctrle 光標移動到最末尾 Ctrlk 刪除此處至末尾的所有內容 Ctrlu 刪除此處至開始的所有內容 Ctrld 刪除當前字符 Ctrlh 刪除當前字符前一個字符 Ctrlw 刪除此處到…

openssl實現雙向認證教程(服務端代碼+客戶端代碼+證書生成)

參考鏈接 openssl實現雙向認證教程&#xff08;服務端代碼客戶端代碼證書生成&#xff09;_huang714的博客-CSDN博客_ssl_ctx_load_verify_locations基于openssl實現https雙向身份認證及安全通信_tutu-hu的博客-CSDN博客_基于openssl實現 注意事項 openssl版本差異很可能導致程…

python用pip安裝pillow_cent 6.5使用pip安裝pillow總是失敗

python:2.7.8阿里云cent os32位virtualenvvirtualenvwrapper之前有一個virtualenv不知道怎么回事成功裝上了pillow之后再在別的virtualenv裝就全都報錯這是為什么 太奇怪了?下載whl安裝&#xff0c;不管哪個版本都說不支持這個系統。imaging.c:3356: error: expected ?.?. ?…

基于openssl和國密算法生成CA、服務器和客戶端證書

參考鏈接 國密自簽名證書生成_三雷科技的博客-CSDN博客_國密證書生成openssl采用sm2進行自簽名的方法_dong_beijing的博客-CSDN博客_openssl sm 前提說明 OpenSSL 1.1.1q 5 Jul 2022 已經實現了國密算法查看是否支持SM2算法openssl ecparam -list_curves | grep -i sm2參考…

h5獲取http請求頭_React 前端獲取http請求頭信息

背景&#xff1a;前端通過react渲染頁面&#xff0c;使用了react-slingshot&#xff0c;相當于是前端跑在一個node服務上面需求&#xff1a;需要通過客戶端通過HTTP請求傳遞來的參數(header里放了token)進行用戶權限的驗證,比如訪問http://localhost:3000/rights/1&#xff0c;…

基于Gmssl庫靜態編譯,實現服務端和客戶端之間的SSL通信

前情提要 將gmssl庫采取靜態編譯的方式&#xff0c;存儲在/usr/local/gmssl路徑下&#xff0c;核心文件涵蓋 include、lib和bin等Ubuntu安裝GmSSL庫適用于ubuntu18和ubuntu20版本_MY CUP OF TEA的博客-CSDN博客 代碼 server #include <stdio.h> #include <stdlib.h&g…

禪道備份功能_更新禪道燃盡圖及數據備份

Last login: Fri May 29 13:52:16 on ttys000mazhenguodeMacBook-Pro:~ mazhenguo$ ssh root192.168.1.2 //登錄服務器root192.168.1.2’s password: //輸入服務器密碼Last login: Fri May 29 13:52:20 2015 from 192.168.1.251[rootmazhenguo ~]# cd /home/app/192.168.1.2/ze…

基于SM2證書實現SSL通信

參考鏈接 ?????基于openssl和國密算法生成CA、服務器和客戶端證書_MY CUP OF TEA的博客-CSDN博客基于上述鏈接&#xff0c;使用國密算法生成CA、服務器和客戶端證書&#xff0c;并實現簽名認證openssl實現雙向認證教程&#xff08;服務端代碼客戶端代碼證書生成&#xff…

列寬一字符等于多少厘米_Excel中行高與列寬單位和厘米的轉換

Excel中行高、列寬尺寸的換算一、先說明一下度量單位的相互換算關系&#xff1a;磅&#xff1a;指打印的字符的高度的度量單位。1 磅近似等于 1/72 英寸&#xff0c;或大約等于 1/28.35 厘米。英寸&#xff1a;1英寸近似等于 2.54 厘米。像素&#xff1a;與顯示解析度有關&…

使用Clion軟件實現基于國密SM2-SM3的SSL安全通信

參考鏈接 Ubuntu安裝GmSSL庫適用于ubuntu18和ubuntu20版本_MY CUP OF TEA的博客-CSDN博客CLion運行程序時添加命令行參數 即設置argv輸入參數_MY CUP OF TEA的博客-CSDN博客基于SM2證書實現SSL通信_MY CUP OF TEA的博客-CSDN博客基于Gmssl庫靜態編譯&#xff0c;實現服務端和客…

基于GmSSL實現server服務端和client客戶端之間SSL通信代碼(升級優化公開版)

參考鏈接 工程搭建介紹 Ubuntu安裝GmSSL庫適用于ubuntu18和ubuntu20版本_MY CUP OF TEA的博客-CSDN博客CLion運行程序時添加命令行參數 即設置argv輸入參數_MY CUP OF TEA的博客-CSDN博客基于SM2證書實現SSL通信_MY CUP OF TEA的博客-CSDN博客基于Gmssl庫靜態編譯&#xff0c…