CN103546689B - The resolution ratio acquisition methods and device of external camera of android system - Google Patents

The resolution ratio acquisition methods and device of external camera of android system Download PDF

Info

Publication number
CN103546689B
CN103546689B CN201310471849.2A CN201310471849A CN103546689B CN 103546689 B CN103546689 B CN 103546689B CN 201310471849 A CN201310471849 A CN 201310471849A CN 103546689 B CN103546689 B CN 103546689B
Authority
CN
China
Prior art keywords
resolution ratio
camera
resolution
android system
character string
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310471849.2A
Other languages
Chinese (zh)
Other versions
CN103546689A (en
Inventor
郝占峰
陆琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Corp
Original Assignee
TCL Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Corp filed Critical TCL Corp
Priority to CN201310471849.2A priority Critical patent/CN103546689B/en
Publication of CN103546689A publication Critical patent/CN103546689A/en
Application granted granted Critical
Publication of CN103546689B publication Critical patent/CN103546689B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Studio Devices (AREA)

Abstract

The invention discloses the resolution ratio acquisition methods and device of external camera of android system, the resolution ratio of all supports of external camera is obtained by video drive layer, is the character string list comprising resolution information by the conversion of resolution of all supports of external camera;The character string list is called, and character string list is write in the camera applications attribute of Android system;Matching primitives are carried out according to the size of the preview interface of Android system camera applications and the resolution ratio of all supports of external camera, resolution ratio of the resolution ratio for selecting most to match as preview interface;The camera applications of Android system are allowd to support resolution ratio to show different external connection camera, the resolution ratio of external camera is enabled preferably to match the display screen of the Android system terminal, compatibility of the Android system to external camera is improved, substantially increases display effect.

Description

The resolution ratio acquisition methods and device of external camera of android system
Technical field
The present invention relates to mobile terminal device, more particularly to a kind of resolution ratio of external camera of android system Acquisition methods and device.
Background technology
With the popularization of mobile terminal particularly 3G smart mobile phones, be integrated with many applications on mobile terminals, for example on Net function, camera function and camera function etc..By taking the terminal using Android system as an example, on Android system Face, what camera applications had become becomes more and more popular, due to the limitation of Android system, when using camera, system It itself can not dynamically be updated according to the resolution ratio that inserted camera is supported, fixed resolution ratio can only be supported.When slotting When entering different cameras, application layer, which can not obtain, is currently inserted into the resolution list that camera provides support.It is existing If technology is bottom when having detected as camera that peripheral hardware inserts, the resolution ratio of multiple fixations can be provided to judge the shooting The resolution ratio supported of head whether in fixed value, if, can normal use, if it was not then can have problem, such as Flower screen or blank screen etc..And because the size of the preview screen of the camera applications of Android system is different, cause extraneous camera Resolution ratio be not necessarily adapted to preview screen, it is likely that so that display effect is bad, distortion is serious.
Therefore, prior art has yet to be improved and developed.
The content of the invention
The technical problem to be solved in the present invention is, for the drawbacks described above of prior art, there is provided a kind of Android system The resolution ratio acquisition methods and device of external camera, it is intended to can not root when solving existing external camera of android system Dynamically updated according to the resolution ratio of external camera, can only support fixed resolution, and the resolution ratio of extraneous camera with The unmatched problem of preview screen of the camera applications of Android system.
The technical proposal for solving the technical problem of the invention is as follows:
A kind of resolution ratio acquisition methods of external camera of android system, wherein, comprise the following steps:
A, the resolution ratio of all supports of external camera is obtained by video drive layer;
B, it is the character string list comprising resolution information by the conversion of resolution of all supports of external camera;
C, the character string list is called, and character string list is write in the camera applications attribute of Android system;
D, according to the size of the preview interface of Android system camera applications and the resolution ratio of all supports of external camera Matching primitives are carried out, resolution ratio of the resolution ratio for selecting most to match as preview interface.
The resolution ratio acquisition methods of described external camera of android system, wherein, the step D is specifically included:
D1, the aspect ratio value for calculating the resolution ratio that each described external camera is supported and the preview interface width The difference of ratios, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When the difference is not pre- When determining in confidential interval, corresponding resolution ratio is deleted;
D2, adjust automatically preview interface resolution ratio, make the resolution ratio of preview interface for the resolution ratio of reservation.
The resolution ratio acquisition methods of described external camera of android system, wherein, the step A also includes:
A1, when the resolution ratio that external camera is supported can not be obtained, set acquiescence support resolution ratio be 640* 480。
The resolution ratio acquisition methods of described external camera of android system, wherein, the step B is specifically included:
B1, the integer of the resolution ratio wide width and high height be respectively converted into corresponding character string, by the use of x as Bound symbol, stored with width x height forms, form a corresponding character string list.
A kind of resolution ratio acquisition device of external camera of android system, wherein, including:
Resolution ratio acquisition module, for obtaining the resolution ratio of all supports of external camera by video drive layer;
Conversion and memory module, for the conversion of resolution of all supports of external camera to be included into resolution information Character string list;
Writing module, for calling the character string list, and should by the camera of character string list write-in Android system With in attribute;
Resolution match module, size and external shooting for the preview interface according to Android system camera applications The resolution ratio of all supports carries out matching primitives, resolution ratio of the resolution ratio for selecting most to match as preview interface.
The resolution ratio acquisition device of described external camera of android system, wherein, the resolution ratio selecting module bag Include:
Computing unit, the aspect ratio value for the resolution ratio supported for calculating each described external camera with it is described pre- Look at interface aspect ratio value difference, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When described When difference is not in predetermined confidence interval, corresponding resolution ratio is deleted;
Resolution adjustment unit, for the resolution ratio of adjust automatically preview interface, the resolution ratio for making preview interface is reservation Resolution ratio.
The resolution ratio acquisition device of described external camera of android system, wherein, the conversion and memory module are used In the integer of the resolution ratio wide width and high height are respectively converted into corresponding character string, by the use of x as bound symbol, Stored with width x height forms, form a corresponding character string list.
The resolution ratio acquisition device of described external camera of android system, wherein, the resolution ratio acquisition module is also For when that can not obtain the resolution ratio that external camera is supported, the resolution ratio for setting acquiescence to support to be 640*480.
The resolution ratio acquisition methods and device of external camera of android system provided by the present invention, are efficiently solved Existing Android system is when using external camera, it is impossible to the resolution ratio supported according to inserted camera Dynamically to update, fixed resolution ratio can only be supported, and when different cameras are inserted, can not obtain to be currently inserted into and take the photograph As head provides the resolution list of support, and the resolution ratio of extraneous camera and the camera applications of Android system is pre- The unmatched problem of screen of looking at, methods described obtain the resolution ratio of all supports of external camera by video drive layer;Will be outer The conversion of resolution for connecing all supports of camera is the character string list comprising resolution information;The character string list is called, And character string list is write in the camera applications attribute of Android system;According to preview circle of Android system camera applications The resolution ratio of all supports of size and external camera in face carries out matching primitives, and the resolution ratio for selecting most to match is used as preview circle The resolution ratio in face so that the camera applications of Android system can support resolution ratio to show different external connection camera, Camera applications are allowd to use highest resolution display picture so that being drawn using the video data that external camera obtains Be not in very big distortion effect during stretching so that the resolution ratio of external camera can preferably match the android systems The display screen for terminal of uniting, improves compatibility of the Android system to external camera, substantially increases display effect, side User use.
Brief description of the drawings
Fig. 1 is the stream of the resolution ratio acquisition methods preferred embodiment of external camera of android system provided by the invention Cheng Tu.
Fig. 2 is the knot of the resolution ratio acquisition device preferred embodiment of external camera of android system provided by the invention Structure block diagram.
Embodiment
The present invention provides a kind of the resolution ratio acquisition methods and device of external camera of android system, to make the present invention Object, technical solution and advantage it is clearer, clear and definite, the embodiment that develops simultaneously referring to the drawings to the present invention further specifically It is bright.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig. 1, Fig. 1 is preferable for the resolution ratio acquisition methods of external camera of android system provided by the invention The flow chart of embodiment, as illustrated, the resolution ratio acquisition methods of the external camera of android system include following step Suddenly:
Step S100, the resolution ratio of all supports of external camera is obtained by video drive layer;
Step S200, it is the character tandem comprising resolution information by the conversion of resolution of all supports of external camera Table;
Step S300, the character string list is called, and character string list is write to the camera applications category of Android system In property;
Step S400, according to the size of the preview interface of Android system camera applications and all supports of external camera Resolution ratio carry out matching primitives, select the resolution ratio of the resolution ratio that most matches as preview interface.
Above-mentioned steps are described in detail with reference to specific embodiment.
The Android system is generally used in terminal, particularly mobile terminal, the mobile terminal include mobile phone, Camera or tablet personal computer etc..In the step s 100, external camera institute is obtained by the I/O Interface Controllers order of video drive layer The resolution ratio supported.Specifically, by changing the video drive layer identification code of Android system, that is, drive in video Increase code in dynamic model block, acquisition is interacted by ioctl (function being managed to the I/O passages of equipment) and kernel The video resolution for all supports of camera that Android system is inserted.
In practical application, in the video driving module of camera applications, a getPixelFormat (char* is added PResolutionList) function, the function are the resolution ratio for obtaining the first-class all supports of hardware device of shooting of insertion, A parameter pResolutionList is transmitted in the function, parameter pResolutionList is for storing acquisition resolution ratio List.Standard I/O interface command ioctl (fd, the VIDIOC_ENUM_ that getPixelFormat functions pass through video drive layer FRAMESIZES, &fsize) function obtains the resolution sizes that the hardware devices such as external camera are supported.In the function Fsize parameters are used for storage resolution.The wide width and high height of resolution ratio are stored in respectively In fsize.discrete.width, fsize.discrete.height.
In step s 200, it is the corresponding character string for including resolution information by the conversion of resolution, is taken the photograph external The conversion of resolution of picture all supports is the character string list comprising resolution information, and is stored.Specifically, first from regarding The wide width values of shaping for the resolution ratio that frequency driving layer obtains are converted into character from a high position to low level to be present in character string list, is counted Calculate and complete wide width afterwards by the use of x as bound symbol, then the high height of resolution ratio is also converted into identical method Corresponding character string forms, so as to form a corresponding character string list comprising resolution information and store.So can be big It is big to improve from bottom, that is, video drive layer, obtain external camera and support the efficiency of resolution ratio, and be easy to application layer It can be more convenient preferably to read these data.
Preferably, the step S200 is specifically included:The integer of the resolution ratio wide width and high height are turned respectively Corresponding character string is changed to, by the use of x as bound symbol, is stored with width x height forms, forms a corresponding character string List.In practical application, in the video driving module of camera applications, a get_resolution_string (int is added Width, int height, char* resolution) function, three parameters of the function passes, width and height are to pass The progressive width and high parameter of video resolution to obtain, resolution is a character pointer.The effect of the function is handle The wide width of the resolution ratio of integer and high height numerical value are converted into character storage into resolution pointers.It is specific next Say, get_resolution_string functions are converted into width and height the character string example of width x height forms Such as(1280 x 720)Store in resolution, due to needing that integer wide width and high height are converted into character string Form, it is therefore desirable to converted with the following method:
The interval range at the wide width and high height of resolution ratio is first determined whether, section is by (10n, 10n+1], n> 0,
Then index=0 is initialized;
Width conversions are inserted into inside resolution character strings first,
resolution[index] = width/ 10n;index ++;
while(n-1>2){
resolution[index] = (width%10n )/10n-1 ;index ++;
n--;
}
resolution[index]=((width%10))+'0';index++;
resolution[index]='x';index++;
Thus the wide width of resolution ratio is inserted into inside character string resolution, then again with same side Method inserts the high height of resolution ratio:
resolution[index] = height/ 10n;index ++;
while(n-1>2){
resolution[index]= (height%10n )/10n-1 ;index ++;
n--;
}
resolution[index]=((height%10))+'0';index++;
By above method be achieved that the wide width and high height of the resolution ratio of acquisition be converted into character string with Width x height forms(For example 1280x720)Store inside resolution.
The get_ for passing through the wide high level of the resolution ratio of acquisition in the step S200 in the step S100 Resolution_string functions are changed, and the form for just the two values being converted into character string saves.
In step S300, the character string list is called, and the character string list is write to the phase of Android system In machine application attribute.Specifically, in the hardware abstraction layer of camera applications, a character pointer is defined PResolutionList, then three kinds of invocation step getPixelFormat functions, obtained with this function and taken the photograph comprising external As the character string list for the resolution information that head is supported, the character string list of acquisition is assigned to pResolutionList characters String pointer.Then the resolution parameter assignments in get_resolution_string functions to getPixelFormat The pResolutionList parameters of (char* pResolutionList) function, so it is achieved that whole The function of getPixelFormat functions.
Then inside the initialization camera applications attribute function in the hardware abstraction layer of camera applications, one is initialized The paramter of camera applications(Parameter)Attribute P, the KEY_SUPPORTED_PREVIEW_SIZES defined in itself to system are closed Key word, then using P.set (KEY_SUPPORTED_PREVIEW_SIZES, pResolutionList) function acquisition The pResolutionList of bottom external hardware equipment is written to inside the attribute information of camera applications.So it is achieved that drive Dynamic model block supports the transmission of resolution ratio to hardware abstraction layer camera.
In the application module of camera, that is, application layer, the Parameter of camera is obtained(Parameter)Object, the object are The attributes object of camera, all properties value of camera is stored in the attribute, passes through the interface getParameter letters of ccf layer Number can directly obtain.According to the Parameter of acquisition, then pass through getSupportedPreviewSizes methods, so that it may To obtain the list that the system passed over from hardware abstraction layer supports resolution ratio.Wherein GetSupportedPreviewSizes methods are exactly that have invoked Parameter.get (KEY_SUPPORTED_PREVIEW_ SIZES) method.By the resolution ratio that bottom is supported by step S300 is delivered among the attribute, therefore obtain The character string list for the resolution ratio that bottom hardware equipment is supported has been contained in Parameter.So, the android System just can dynamically update in external camera according to the resolution ratio that inserted camera is supported, when insertion difference is taken the photograph When as head, it can also obtain and be currently inserted into the resolution list that camera provides support so that camera applications can be to not Support resolution ratio to be shown with camera, improve compatibility of the Android system to camera.
In the step S400, according to the size and external camera of the preview interface of Android system camera applications The resolution ratio of all supports carries out matching primitives, resolution ratio of the resolution ratio for selecting most to match as preview interface.Specifically, By above-mentioned steps S300, the Android system can be compatible to external camera, and camera applications can be to different shootings Head supports resolution ratio to be shown, for more preferable display effect, the present invention is further passed through by an optimal algorithm According to the width and ratios of the display screen of Android system terminal, the resolution ratio of all supports of external camera is sieved Choosing, filters out resolution ratio of the resolution ratio most matched as preview interface.In general, the preview screen of the camera applications is The display screen of terminal.
In practical application, Android system is applied in each terminal, Android system carries with each terminal Camera is matched, and resolution ratio has been fixed, but the display effect of different resolution ratio is different.The step S400 is specific Including:S410, the aspect ratio value for calculating the resolution ratio that each described external camera is supported and the preview interface width The difference of ratios, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When the difference is not pre- When determining in confidential interval, corresponding resolution ratio is deleted;S420, adjust automatically preview interface resolution ratio, make preview interface Resolution ratio is the resolution ratio retained.Specifically, calculate the preview interface of the camera applications of Android system wide width and High height ratio width/height, and calculate the wide width and height of the resolution ratio that each external camera is supported Height ratio width/height, both ratio is subjected to subtraction, obtains a difference, then judge that the difference is It is no in predetermined confidential interval.For example, confidential interval is(0,0.05)The aspect ratio value of the display screen of terminal is 3/ 4, and the aspect ratio value of the resolution ratio of external camera is 9/16, both differences are 3/16, and the difference is 3/16, i.e., 0.1875, not in confidential interval, then show that the resolution ratio is not suitable for showing on the display screen of the terminal, then will be corresponding Resolution ratio delete.If in confidential interval, corresponding resolution ratio is added among optimal resolution list both differences, from And obtain the resolution ratio that preview interface best matches to adapt to camera.Then, the resolution ratio of adjust automatically preview interface, makes preview The resolution ratio at interface is the resolution ratio retained, so that preview interface adjust automatically best image in the environment of different cameras Resolution ratio, the display effect of preview interface is reached optimal, it is simultaneous under intelligence system camera applications environment to improve camera Capacitive.The difference of the aspect ratio value of resolution ratio and the aspect ratio value of terminal display is further less than a model by the present invention Enclose, may be such that in the video data obtained using external camera be not in very big distortion effect in drawing process, make The display screen of the Android system terminal can preferably be matched by obtaining the resolution ratio of external camera, be brought preferably for user Visual effect.
Further, the step S100 also includes:When the resolution ratio that external camera is supported can not be obtained, set The resolution ratio that acquiescence is supported is 640*480.Specifically, because external camera is when inserting the terminal of Android system, meeting There is the problem of leading to not identification situations such as connection is not close, then default resolution 640*480 is then set.The default resolution Corresponding setting often can be carried out with resolution ratio according to market.
The resolution ratio acquisition methods of external camera of android system provided by the invention, by changing Android system Video drive layer identification code, acquisition system is interacted by ioctl (function being managed to the I/O passages of equipment) and kernel The video resolution that inserted camera is supported, then in hardware abstraction layer by calling the code that video drive layer adds to obtain The resolution list that video is supported, then insert by camera hardware abstraction layers the method for camera attribute and acquisition system supported Resolution list is inserted into the Hash table of the keyword of corresponding camera attribute;Application layer has been reserved in advance by primary framework Interface, this interface is called to obtain the list that corresponding camera supports resolution ratio, so that camera applications can be to difference Camera supports resolution ratio to be shown, improves compatibility so that camera can use highest resolution to show that preview is drawn Face.Further, optimized algorithm is added in application layer, by by the aspect ratio value of resolution ratio and Android system camera applications Preview interface aspect ratio value contrast, the resolution ratio for not having preferable display effect for the display screen is deleted, retained preferable The resolution list of display effect, display resolution is configured further according to the resolution ratio in this list so that preview circle The display effect in face reaches optimal.
Resolution ratio acquisition methods based on above-mentioned external camera of android system, present invention also offers one kind The resolution ratio acquisition device of external camera of android system, as shown in Fig. 2 including:
Resolution ratio acquisition module 10, for obtaining the resolution ratio of all supports of external camera by video drive layer;Tool Body is as described in step S100;
Conversion and memory module 20, for the conversion of resolution of all supports of external camera to be included into resolution information Character string list;Specifically as described in step S200;
Writing module 30, for calling the character string list, and character string list is write to the camera of Android system In application attribute;Specifically as described in step S300;
Resolution match module 40, for the preview interface according to Android system camera applications size and external take the photograph As the resolution ratio of all supports carries out matching primitives, resolution ratio of the resolution ratio that selection most matches as preview interface;Specifically As described in step S400.
Further, the resolution ratio selecting module 40 includes:
Computing unit, the aspect ratio value for the resolution ratio supported for calculating each described external camera with it is described pre- Look at interface aspect ratio value difference, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When described When difference is not in predetermined confidence interval, corresponding resolution ratio is deleted;
Resolution adjustment unit, for the resolution ratio of adjust automatically preview interface, the resolution ratio for making preview interface is reservation Resolution ratio.
Preferably, the conversion and memory module 20 are used to divide the integer of the resolution ratio wide width and high height Corresponding character string is not converted to, by the use of x as bound symbol, is stored with width x height forms, is formed a corresponding word Accord with tandem table.
Preferably, the resolution ratio acquisition module 10 is additionally operable in the resolution ratio that can not be obtained external camera and supported When, the resolution ratio for setting acquiescence to support is 640*480.
In summary, the resolution ratio acquisition methods and device of a kind of external camera of android system provided by the invention, Methods described obtains the resolution ratio of all supports of external camera by video drive layer;By point of all supports of external camera Resolution is converted to the character string list comprising resolution information;The character string list is called, and character string list is write In the camera applications attribute of Android system;According to the size of the preview interface of Android system camera applications and external shooting The resolution ratio of all supports carries out matching primitives, resolution ratio of the resolution ratio for selecting most to match as preview interface;So that The camera applications of Android system can support resolution ratio to show different external connection camera, improve android systems The compatibility united to external camera so that camera applications can use highest resolution display picture, be brought greatly for user Big convenience, its implementation is simple, is realized by software, and cost is relatively low;Always according to the preview of Android system camera applications The resolution ratio of all supports of size and external camera at interface carries out matching primitives, and the resolution ratio for selecting most to match is as preview The resolution ratio at interface so that the display effect of preview interface reaches optimal, greatly reduces distortion phenomenon.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention Protect scope.

Claims (4)

1. the resolution ratio acquisition methods of a kind of external camera of android system, it is characterised in that comprise the following steps:
A, the resolution ratio of all supports of external camera is obtained by video drive layer;By the video for changing Android system Layer identification code is driven, the video for obtaining all supports of camera that Android system is inserted is interacted by ioctl and kernel Resolution ratio;
B, it is the character string list comprising resolution information by the conversion of resolution of all supports of external camera;
C, the character string list is called, and character string list is write in the camera applications attribute of Android system;In camera The hardware abstraction layer of application, a character pointer pResolutionList is defined, call getPixelFormat functions, The character string list of acquisition is assigned to pResolutionList character string pointers;Then in the hardware abstraction layer of camera applications Initialization camera applications attribute function inside, initialize the paramter of a camera applications, use P.set functions obtaining The pResolutionList of bottom external hardware equipment be written to inside the attribute informations of camera applications;In the application of camera Module, the Parameter objects of camera are obtained, the object is the attributes object of camera, and all of camera are stored in attribute Property value, according to the Parameter of acquisition, then by getSupportedPreviewSizes methods, obtain and taken out from hardware The system passed over as module supports the list of resolution ratio;
D, carried out according to the size of the preview interface of Android system camera applications and the resolution ratio of all supports of external camera Matching primitives, resolution ratio of the resolution ratio for selecting most to match as preview interface;
The step D is specifically included:
D1, the aspect ratio value for calculating the resolution ratio that each described external camera is supported and the preview interface the ratio of width to height The difference of value, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When the difference is not in pre- fixation When believing in section, corresponding resolution ratio is deleted;
D2, adjust automatically preview interface resolution ratio, make the resolution ratio of preview interface for the resolution ratio of reservation;
The step B is specifically included:
B1, the integer of the resolution ratio wide width and high height be respectively converted into corresponding character string, connection is used as by the use of x Symbol, stored with width x height forms, form a corresponding character string list;
First the wide width values of shaping of the resolution ratio obtained from video drive layer are converted into character from a high position to low level has character In tandem table, calculate and complete by the use of x as bound symbol after wide width, then the height with identical method resolution ratio Height is also converted into corresponding character string forms, forms a character string list comprising resolution information accordingly and deposits Storage.
2. the resolution ratio acquisition methods of external camera of android system according to claim 1, it is characterised in that institute Stating step A also includes:
A1, when the resolution ratio that external camera is supported can not be obtained, set acquiescence support resolution ratio be 640*480.
A kind of 3. resolution ratio acquisition device of external camera of android system, it is characterised in that including:
Resolution ratio acquisition module, for obtaining the resolution ratio of all supports of external camera by video drive layer;Pass through modification The video drive layer identification code of Android system, interacted by ioctl and kernel and obtain taking the photograph of being inserted of Android system As the video resolution of all supports;
Conversion and memory module, for being the character comprising resolution information by the conversion of resolution of all supports of external camera Tandem table;
Writing module, for calling the character string list, and character string list is write to the camera applications category of Android system In property;In the hardware abstraction layer of camera applications, a character pointer pResolutionList is defined, is called GetPixelFormat functions, the character string list of acquisition is assigned to pResolutionList character string pointers;Then in camera Inside initialization camera applications attribute function in the hardware abstraction layer of application, one camera applications of initialization Paramter, the pResolutionList of the bottom external hardware equipment of acquisition is written to camera applications using P.set functions Attribute information inside;In the application module of camera, the Parameter objects of camera are obtained, the object is the attribute of camera Object, all properties value of camera is stored in attribute, according to the Parameter of acquisition, is then passed through GetSupportedPreviewSizes methods, obtain the row that the system passed over from hardware abstraction layer supports resolution ratio Table;
Resolution match module, size and the external camera institute for the preview interface according to Android system camera applications The resolution ratio for having support carries out matching primitives, resolution ratio of the resolution ratio for selecting most to match as preview interface;
The resolution ratio selecting module includes:
Computing unit, aspect ratio value and preview circle of the resolution ratio supported for calculating each described external camera The difference of the aspect ratio value in face, when the difference is in predetermined confidence interval, corresponding resolution ratio is retained;When the difference When not in predetermined confidence interval, corresponding resolution ratio is deleted;
Resolution adjustment unit, for the resolution ratio of adjust automatically preview interface, the resolution ratio of preview interface is set to divide for what is retained Resolution;
The conversion and memory module are used to the integer of the resolution ratio wide width and high height being respectively converted into accordingly Character string, by the use of x as bound symbol, stored with width x height forms, form a corresponding character string list;
First the wide width values of shaping of the resolution ratio obtained from video drive layer are converted into character from a high position to low level has character In tandem table, calculate and complete by the use of x as bound symbol after wide width, then the height with identical method resolution ratio Height is also converted into corresponding character string forms, forms a character string list comprising resolution information accordingly and deposits Storage.
4. the resolution ratio acquisition device of external camera of android system according to claim 3, it is characterised in that institute State resolution ratio acquisition module to be additionally operable to when the resolution ratio that external camera is supported can not be obtained, the resolution for setting acquiescence to support Rate is 640*480.
CN201310471849.2A 2013-10-11 2013-10-11 The resolution ratio acquisition methods and device of external camera of android system Expired - Fee Related CN103546689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310471849.2A CN103546689B (en) 2013-10-11 2013-10-11 The resolution ratio acquisition methods and device of external camera of android system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310471849.2A CN103546689B (en) 2013-10-11 2013-10-11 The resolution ratio acquisition methods and device of external camera of android system

Publications (2)

Publication Number Publication Date
CN103546689A CN103546689A (en) 2014-01-29
CN103546689B true CN103546689B (en) 2018-02-13

Family

ID=49969704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310471849.2A Expired - Fee Related CN103546689B (en) 2013-10-11 2013-10-11 The resolution ratio acquisition methods and device of external camera of android system

Country Status (1)

Country Link
CN (1) CN103546689B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103841326B (en) * 2014-02-26 2017-05-17 宇龙计算机通信科技(深圳)有限公司 Video recording method and device
CN104270579B (en) * 2014-09-24 2018-06-05 青岛海信移动通信技术股份有限公司 A kind of terminal applies interface pixel method of adjustment and terminal
CN104615396B (en) * 2015-01-28 2018-05-04 福建升腾资讯有限公司 A kind of resolution ratio automatic adjusting method and system based on Android
CN106506932A (en) * 2015-09-08 2017-03-15 中兴通讯股份有限公司 The acquisition methods and device of image
CN105893283A (en) * 2015-11-20 2016-08-24 乐视移动智能信息技术(北京)有限公司 Camera parameter reading-writing method and apparatus as well as terminal device
CN106293589B (en) * 2016-08-31 2019-04-12 宇龙计算机通信科技(深圳)有限公司 A kind of method, apparatus and terminal that preview resolution is set
CN106657864A (en) * 2016-12-27 2017-05-10 无锡纽微特科技有限公司 Video call system and method for switching resolution ratio in video call
CN110958399B (en) * 2019-12-09 2021-06-29 Oppo广东移动通信有限公司 High dynamic range image HDR realization method and related product
CN111010513B (en) * 2019-12-23 2021-07-02 北大方正集团有限公司 Picture acquisition method and system and terminal equipment
CN111212227B (en) * 2020-01-13 2021-07-23 广州视源电子科技股份有限公司 Method, device and equipment for configuring video resolution of camera and storage medium
CN112051976B (en) * 2020-08-24 2022-09-30 南京巨鲨显示科技有限公司 Method for self-adapting optimal resolution and text size of display
CN114727004A (en) * 2021-01-05 2022-07-08 北京小米移动软件有限公司 Image acquisition method and device, electronic equipment and storage medium
CN114422694B (en) * 2022-01-18 2024-03-26 杭州逗酷软件科技有限公司 Preview resolution adaptation method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877438A (en) * 2006-07-10 2006-12-13 南京邮电大学 Self-adaptive automatic focusing method used in digital camera
CN102270109A (en) * 2011-08-23 2011-12-07 上海网达软件有限公司 Self-converting method and system for user interfaces with different resolutions
CN102707946A (en) * 2012-04-17 2012-10-03 Tcl集团股份有限公司 Application program interface processing method and device
CN102984494A (en) * 2012-12-06 2013-03-20 北京小米科技有限责任公司 Video communication method and device
CN102981596A (en) * 2012-12-21 2013-03-20 东莞宇龙通信科技有限公司 Terminal and screen interface display method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7629945B2 (en) * 2001-05-11 2009-12-08 Xerox Corporation Mixed resolution displays

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1877438A (en) * 2006-07-10 2006-12-13 南京邮电大学 Self-adaptive automatic focusing method used in digital camera
CN102270109A (en) * 2011-08-23 2011-12-07 上海网达软件有限公司 Self-converting method and system for user interfaces with different resolutions
CN102707946A (en) * 2012-04-17 2012-10-03 Tcl集团股份有限公司 Application program interface processing method and device
CN102984494A (en) * 2012-12-06 2013-03-20 北京小米科技有限责任公司 Video communication method and device
CN102981596A (en) * 2012-12-21 2013-03-20 东莞宇龙通信科技有限公司 Terminal and screen interface display method

Also Published As

Publication number Publication date
CN103546689A (en) 2014-01-29

Similar Documents

Publication Publication Date Title
CN103546689B (en) The resolution ratio acquisition methods and device of external camera of android system
US11509807B2 (en) Electronic device and method for generating thumbnails based on captured images
EP3039530B1 (en) Method and system for presenting content
US20160127653A1 (en) Electronic Device and Method for Providing Filter in Electronic Device
CN104333708B (en) Photographic method, camera arrangement and terminal
US10348971B2 (en) Electronic device and method for generating thumbnails based on captured images
US20170134689A1 (en) Photographing processing method and system based on mobile terminal
CN101764971B (en) On-screen display device and on-screen display method thereof
CN104798376A (en) Camera command set host command translation
CN105279006B (en) Screen capture method and terminal based on Android system
CN106134189A (en) Image processing apparatus, camera head, image processing method and program
CN105227850A (en) Enable metadata store subsystem
CN111859874B (en) Form generation method and system, video playing device and computer readable medium
CN106911937A (en) The collocation method and system of a kind of live middle present banner background colour
CA2566787C (en) Method for synthesizing dynamic virtual figures
US20150112997A1 (en) Method for content control and electronic device thereof
CN104346029B (en) The system and method for dynamic icon display control is realized in electronic equipment on OSD interfaces
CN115442517B (en) Image processing method, electronic device, and computer-readable storage medium
CN114449171B (en) Method for controlling camera, terminal device, storage medium and program product
CN109391855B (en) Method for determining display brightness value and set top box
CN114945019B (en) Data transmission method, device and storage medium
CN104732040B (en) Product modeling layout method and device
CN107256137A (en) image processing method and device
CN117499797B (en) Image processing method and related equipment
CN110941596A (en) Disk space release method and device, computing equipment and computer storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180213

CF01 Termination of patent right due to non-payment of annual fee