CN103677848A - Camera control method based on Android - Google Patents
Camera control method based on Android Download PDFInfo
- Publication number
- CN103677848A CN103677848A CN201310734558.8A CN201310734558A CN103677848A CN 103677848 A CN103677848 A CN 103677848A CN 201310734558 A CN201310734558 A CN 201310734558A CN 103677848 A CN103677848 A CN 103677848A
- Authority
- CN
- China
- Prior art keywords
- camera
- application program
- application
- allocation table
- resource allocation
- 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.)
- Granted
Links
Images
Abstract
The invention discloses a camera control method based on the Android. The camera control method includes the steps that first, a camera resource allocation table, an application running queue and an application waiting queue are established, wherein the information of the camera resource allocation table contains the name of a camera, a mark whether in use or not, the names of applications using the camera and the priority of the applications, the application running queue represents a list of the applications using the camera, and the application waiting queue represents a list of the applications waiting for use of the camera; second, the application running queue is updated in real time, if a new application A requiring to calling the camera exists, the camera resource allocation table is scanned, and whether the calling application succeeds or not is judged. The camera control method based on the Android solves the problems that in the Android system, the multiple applications compete to use the same camera to achieve control management, and a user avoids manually releasing the applications occupying the camera resources.
Description
Technical field
The present invention relates to a kind of camera control method based on Android, be mainly used in the control of camera in vehicle-mounted terminal equipment.
Background technology
In the system of Android, the Camera object that the use of camera need to be used system to be provided operates, but for same camera, Camera object is all to monopolize use, after a program is opened a camera, if it does not discharge this camera, other program is out of use.In common application scene, this can not bring too large problem, can close a method that takies the program of camera by pass and discharge camera.But, the special occasions using at some car-mounted terminals, for example, if be same camera for the camera of taking pictures and moveing backward, and user hangs reverse gear, and screens switch is to reversing program, but, if be now in an emergency, need to carry out camera head monitor candid photograph, just there will be situation about can not capture.Certainly, also can install respectively and take pictures and backup camera, but do like this, the one, increase cost, the 2nd, some Android system version (for example version before Android2.3) does not support to open the method for two cameras simultaneously.
For this reason, application number is 201310312262.7 patent of invention, the control method that a kind of Android equipment camera is used is disclosed, its method comprises following content: when application program launching, read preset configuration file, in described preset configuration file, configured all information that need to use the application program of described camera in described Android equipment; By ccf layer, judge whether the described application program starting is configured in described preset configuration file; If the described application program starting is configured in described preset configuration file, the described application program of described camera being distributed to separately to startup by described ccf layer is used.This invention makes the application program in Android system when starting, just read preset configuration file, if this application program is configured in this preset configuration file, by ccf layer, camera is distributed to separately to this application program and use, solve the problem clashing when a plurality of application programs take camera simultaneously.But there are the following problems for this patent of invention: the foundation of the configuration file described in this patent of invention and reading by system framework layer completes, therefore need to revise system framework layer, if not the Android operating system of customization, cannot accomplish to revise system framework layer identification code; In addition, this patent of invention is after camera resource is taken by some application programs, if there is other application program, need to use camera, only that the camera that an application program takies is closed in simple and crude pass, then camera is distributed to new application program, there is no the judgement of priority, this way is inappropriate in some application scenario.
Summary of the invention
Therefore, for above-mentioned problem, the present invention proposes a kind of camera control method based on Android, the preemption scheduling algorithm of employing based on static priority, the camera of system is carried out to unified management, meet under some application scenario, the specific (special) requirements of a plurality of application to the contention of same camera, and do not need to revise the code of ccf layer.
In order to solve the problems of the technologies described above, thinking of the present invention is, utilize the serviced component of Android system, provide a camera to control service, it externally provides video registration and unregistration interface, define broadcast simultaneously, by broadcast, each application has been stopped, suspending, resumed the operation of camera.Camera is controlled service at camera resource allocation table of internal maintenance, and the use of camera is carried out to unified management.Each of resource allocation table comprise resource name (camera title), whether in program name, these information of program priority of using, using this resource.In resource allocation table, can each of resource allocation table be retrieved, be revised by resource name.When registration, need to use the application program of camera to import log-on message (comprising resource name, application priorities that application name, needs are used) into camera control service, it is programme distribution camera control authority that camera is controlled service employing static priority preemption scheduling algorithm, if program can be obtained control, succeed in registration, can carry out camera control, the program releasing resource of simultaneously notifying other to take camera; If registration failure, pushes waiting list by program information, wait for contention for resources.
Concrete, the technical solution adopted in the present invention is that a kind of camera control method based on Android, comprises the steps:
Step 1: set up camera resource allocation table, application program operation queue and application program waiting list; The information of described camera resource allocation table comprise camera title, whether at the sign using, use the application name of this camera and the priority of this application program; Application program operation queue represents to use the application list of camera, and application program waiting list such as represents at the application list of camera to be used;
Step 2: real-time update application program operation queue, call if necessary the new application A of camera,, according to the relevant information scan camera shooting head resource allocation table of application A, this relevant information comprises the camera information that title, priority, its application of application A are called; If the camera that this application A application is called is unoccupied, forward step 3 to, if occupied, whether the priority that judges the application program B that takies this camera is higher than this application A, if so, forward step 4 to, if not, suspend application program B, and the relevant information of this application program B is write to application program waiting list;
Step 3: revise camera resource allocation table, the relevant information of this application A is write to camera resource allocation table, use camera resource;
Step 4: the relevant information of application A is write to application program waiting list.
Further, this camera control method also comprises the step of nullifying application program, this step comprises following process: receive the de-registration request of application program, obtain the relevant information of this application program, this relevant information comprises title, the priority of application program, the camera information of its use; Revise camera resource allocation table, delete the relevant information of this application program; Scan application program waiting list simultaneously, according to priority, select the next application program of using this camera, and the relevant information of this application program is write to camera resource allocation table, from application program waiting list the inside, remove simultaneously.
That is to say, application program has an opportunity to obtain the right to use of camera in both cases: when 1, other application program is nullified; 2, this application program is moved (registration again) again.
Further, in described step 1, the application program in application program waiting list sorts according to priority.First the priority of each application program of application camera is set in advance, such as 10 ranks such as to set priority are 1-10, be worth larger expression priority higher; Then each application program is sequentially arranged.
The present invention passes through such scheme, compared with prior art, the beneficial effect of invention technology is: solved the control and management of Android system when a plurality of application exist contention to same camera, avoided user's manual releasing to take the program of camera resource, made user more convenient to operate; Improve the reusing degree of system resource, avoided different application scene that the situation of different cameras need to be installed.
Accompanying drawing explanation
Fig. 1 is system architecture diagram of the present invention;
Fig. 2 is the process flow diagram of registrer application in camera control method of the present invention;
Fig. 3 is the process flow diagram of cancellation application program of the present invention.
Embodiment
Now the present invention is further described with embodiment by reference to the accompanying drawings.
Fig. 1 is the system architecture diagram of the camera control method based on Android of the present invention, and it comprises application program unit, camera control service unit and camera unit.
Wherein, application program unit represents to use each application program of system camera.
Camera is controlled service unit application programs unit registration and unregistration interface is provided, and controlling application program stops, suspending or reruns; The service condition of camera resource is carried out to record, realize camera control flow.Wherein application program operation queue has been preserved the application information that obtained camera resource in system (comprising application name, shared camera resource, application priorities); Application program waiting list has been preserved the application information (camera resource, the application priorities of comprise application name, applying for) that temporarily can not use camera resource because camera resource is occupied; Camera the Resources list has recorded the service condition of each camera resource.
Camera unit represents the camera resource for each application program that system exists.
Fig. 2 is the treatment scheme of camera control method of the present invention, has shown that application program controls by camera the whole workflow that service is registered, and comprises the steps:
A. increase camera and control service, comprise the steps:
A1. camera the Resources list of initialization system, in default system, each camera resource, can be for each application program in idle condition;
A2. initialization application program operation queue, queue is defaulted as sky, represents to use camera without any application program;
A3. initialization application program waiting list, queue is defaulted as sky, represents without any application program camera resource;
A4. each camera resource name in define system, the priority of application programs arranges, and setting priority is 1-10, is worth larger expression priority higher.
B. registrer application, application obtains the right to use of certain camera resource, comprises the steps:
B1. call camera and control the registration interface that service provides, import the relevant information of application program into camera and control service, these information comprise application name, application priorities, camera resource name;
B2. camera is controlled service judgement by retrieve resources allocation table, judges that whether this camera resource is occupied, if occupied, goes to step B3, otherwise goes to step B5;
B3. the priority that the application program that judges current registration is served in camera control, whether higher than the priority that takies the application program of camera, if priority is high, goes to step B4;
B4. camera is controlled service and is sent the use that broadcast announcement takies the application program time-out camera resource of camera resource, and this application program is pushed to waiting list;
B5. camera is controlled service and is revised resource allocation table, notice accreditation process, and this succeeds in registration, and can use camera resource;
B6. camera is controlled this registration failure of Service Notification accreditation process, can not use this camera, and this application program is pushed to waiting list.
Fig. 3 has shown that application program controls by camera the workflow that service is nullified:
C. nullify application program, abandon the use of camera resource, comprise the steps:
C1. call the cancellation interface that camera service provides, import application information into camera and control service, comprise application name, application priorities, camera resource name;
C2. camera is controlled service and is revised resource allocation table;
C3. camera is controlled to serve and is judged that whether the application program in waiting list meets service condition, if met, goes to step C4;
C4. notify this application program to move, and revise resource allocation table.
In sum, adopt method of the present invention, by set up camera between application program and camera hardware, control service unit, solved the control and management of Android system when a plurality of application exist contention to same camera, avoid user's manual releasing to take the program of camera resource, make user more convenient to operate, improved the reusing degree of system resource.
Although specifically show and introduced the present invention in conjunction with preferred embodiment; but those skilled in the art should be understood that; within not departing from the spirit and scope of the present invention that appended claims limits; can make a variety of changes the present invention in the form and details, be protection scope of the present invention.
Claims (3)
1. the camera control method based on Android, comprises the steps:
Step 1: set up camera resource allocation table, application program operation queue and application program waiting list; The information of described camera resource allocation table comprise camera title, whether at the sign using, use the application name of this camera and the priority of this application program; Application program operation queue represents to use the application list of camera, and application program waiting list such as represents at the application list of camera to be used;
Step 2: real real-time update application program operation queue, call if necessary the new application A of camera,, according to the relevant information scan camera shooting head resource allocation table of application A, this relevant information comprises the camera information that title, priority, its application of application A are called; If the camera that this application A application is called is unoccupied, forward step 3 to, if occupied, whether the priority that judges the application program B that takies this camera is higher than this application A, if so, forward step 4 to, if not, suspend application program B, and the relevant information of this application program B is write to application program waiting list;
Step 3: revise camera resource allocation table, the relevant information of this application A is write to camera resource allocation table, use camera resource;
Step 4: the relevant information of application A is write to application program waiting list.
2. the camera control method based on Android according to claim 1, it is characterized in that: this camera control method also comprises the step of nullifying application program, this step comprises following process: the de-registration request that receives application program, obtain the relevant information of this application program, this relevant information comprises title, the priority of application program, the camera information of its use; Revise camera resource allocation table, delete the relevant information of this application program; Scan application program waiting list simultaneously, according to priority, select the next application program of using this camera, and the relevant information of this application program is write to camera resource allocation table, from application program waiting list the inside, remove simultaneously.
3. the camera control method based on Android according to claim 1, is characterized in that: in described step 1, the application program in application program waiting list sorts according to priority.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310734558.8A CN103677848B (en) | 2013-12-27 | 2013-12-27 | A kind of camera control method based on Android |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310734558.8A CN103677848B (en) | 2013-12-27 | 2013-12-27 | A kind of camera control method based on Android |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103677848A true CN103677848A (en) | 2014-03-26 |
CN103677848B CN103677848B (en) | 2018-11-16 |
Family
ID=50315515
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310734558.8A Active CN103677848B (en) | 2013-12-27 | 2013-12-27 | A kind of camera control method based on Android |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103677848B (en) |
Cited By (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103995787A (en) * | 2014-05-15 | 2014-08-20 | Tcl集团股份有限公司 | Regulation and control method and device for camera applications |
CN104394305A (en) * | 2014-11-24 | 2015-03-04 | 上海盈方微电子有限公司 | Compatibility method for supporting external mobile camera and built-in camera of mobile equipment in Android system |
CN104778041A (en) * | 2015-03-24 | 2015-07-15 | 四川长虹电器股份有限公司 | Management method and management system for multi-program shared speech equipment |
CN105068945A (en) * | 2015-08-03 | 2015-11-18 | Tcl集团股份有限公司 | Camera distribution method and system for Android system |
CN106033246A (en) * | 2015-03-09 | 2016-10-19 | 联想(北京)有限公司 | A data transmission method and an electronic apparatus |
CN106161938A (en) * | 2016-07-22 | 2016-11-23 | 深圳天珑无线科技有限公司 | A kind of flash lamp deployment method and device |
CN106775988A (en) * | 2016-12-30 | 2017-05-31 | 广东欧珀移动通信有限公司 | A kind of data processing method and equipment |
WO2017190450A1 (en) * | 2016-05-03 | 2017-11-09 | 深圳Tcl数字技术有限公司 | Process closing method and apparatus |
WO2018093688A1 (en) * | 2016-11-18 | 2018-05-24 | Microsoft Technology Licensing, Llc | Dynamically switching control sharing of camera resources |
CN108322640A (en) * | 2017-12-27 | 2018-07-24 | 武汉长江通信智联技术有限公司 | A kind of method and system for mostly application being realized based on broadcast mechanism while calling camera |
CN108429879A (en) * | 2018-02-13 | 2018-08-21 | 广东欧珀移动通信有限公司 | Electronic equipment, camera control method and Related product |
CN110505390A (en) * | 2019-09-24 | 2019-11-26 | 深圳创维-Rgb电子有限公司 | Television set and its camera call method, control device and readable storage medium storing program for executing |
CN111222124A (en) * | 2020-01-16 | 2020-06-02 | 北京梧桐车联科技有限责任公司 | Method, device, equipment and storage medium for using authority distribution |
CN112399232A (en) * | 2019-08-18 | 2021-02-23 | 海信视像科技股份有限公司 | Display equipment, camera priority use control method and device |
CN113377693A (en) * | 2021-08-12 | 2021-09-10 | 杭州当贝网络科技有限公司 | Control method for camera used by application program and terminal device |
CN113518183A (en) * | 2021-07-23 | 2021-10-19 | 北京字节跳动网络技术有限公司 | Camera calling method and device and electronic equipment |
CN113778641A (en) * | 2021-08-09 | 2021-12-10 | 荣耀终端有限公司 | Method for controlling camera, electronic device and computer readable storage medium |
CN114079812A (en) * | 2020-08-21 | 2022-02-22 | 海信视像科技股份有限公司 | Display equipment and camera control method |
CN115225720A (en) * | 2022-09-20 | 2022-10-21 | 亿咖通(北京)科技有限公司 | Video stream distribution method, controller, vehicle, storage medium, and program product |
CN115297259A (en) * | 2022-07-27 | 2022-11-04 | 天翼云科技有限公司 | Camera management method, terminal and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1806228A (en) * | 2003-06-10 | 2006-07-19 | 索尼爱立信移动通信日本株式会社 | Resource management method and device, resource management program, and storage medium |
CN102147725A (en) * | 2011-03-29 | 2011-08-10 | 福州瑞芯微电子有限公司 | Method for supporting dual cameras in Android |
CN103106117A (en) * | 2012-12-25 | 2013-05-15 | 青岛海信电器股份有限公司 | Resource allocation method and electronic equipment |
-
2013
- 2013-12-27 CN CN201310734558.8A patent/CN103677848B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1806228A (en) * | 2003-06-10 | 2006-07-19 | 索尼爱立信移动通信日本株式会社 | Resource management method and device, resource management program, and storage medium |
CN102147725A (en) * | 2011-03-29 | 2011-08-10 | 福州瑞芯微电子有限公司 | Method for supporting dual cameras in Android |
CN103106117A (en) * | 2012-12-25 | 2013-05-15 | 青岛海信电器股份有限公司 | Resource allocation method and electronic equipment |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103995787A (en) * | 2014-05-15 | 2014-08-20 | Tcl集团股份有限公司 | Regulation and control method and device for camera applications |
CN104394305A (en) * | 2014-11-24 | 2015-03-04 | 上海盈方微电子有限公司 | Compatibility method for supporting external mobile camera and built-in camera of mobile equipment in Android system |
CN106033246A (en) * | 2015-03-09 | 2016-10-19 | 联想(北京)有限公司 | A data transmission method and an electronic apparatus |
CN106033246B (en) * | 2015-03-09 | 2020-03-24 | 联想(北京)有限公司 | Data transmission method and electronic equipment |
CN104778041A (en) * | 2015-03-24 | 2015-07-15 | 四川长虹电器股份有限公司 | Management method and management system for multi-program shared speech equipment |
CN105068945A (en) * | 2015-08-03 | 2015-11-18 | Tcl集团股份有限公司 | Camera distribution method and system for Android system |
WO2017190450A1 (en) * | 2016-05-03 | 2017-11-09 | 深圳Tcl数字技术有限公司 | Process closing method and apparatus |
CN106161938B (en) * | 2016-07-22 | 2019-05-14 | 深圳天珑无线科技有限公司 | A kind of flash lamp deployment method and device |
CN106161938A (en) * | 2016-07-22 | 2016-11-23 | 深圳天珑无线科技有限公司 | A kind of flash lamp deployment method and device |
WO2018093688A1 (en) * | 2016-11-18 | 2018-05-24 | Microsoft Technology Licensing, Llc | Dynamically switching control sharing of camera resources |
CN106775988A (en) * | 2016-12-30 | 2017-05-31 | 广东欧珀移动通信有限公司 | A kind of data processing method and equipment |
CN108322640A (en) * | 2017-12-27 | 2018-07-24 | 武汉长江通信智联技术有限公司 | A kind of method and system for mostly application being realized based on broadcast mechanism while calling camera |
CN108322640B (en) * | 2017-12-27 | 2020-10-27 | 武汉长江通信智联技术有限公司 | Method and system for realizing simultaneous calling of multiple applications to camera based on broadcast mechanism |
CN108429879A (en) * | 2018-02-13 | 2018-08-21 | 广东欧珀移动通信有限公司 | Electronic equipment, camera control method and Related product |
CN108429879B (en) * | 2018-02-13 | 2020-12-25 | Oppo广东移动通信有限公司 | Electronic apparatus, camera control method, camera control apparatus, and computer-readable storage medium |
CN112399232A (en) * | 2019-08-18 | 2021-02-23 | 海信视像科技股份有限公司 | Display equipment, camera priority use control method and device |
CN110505390A (en) * | 2019-09-24 | 2019-11-26 | 深圳创维-Rgb电子有限公司 | Television set and its camera call method, control device and readable storage medium storing program for executing |
CN111222124A (en) * | 2020-01-16 | 2020-06-02 | 北京梧桐车联科技有限责任公司 | Method, device, equipment and storage medium for using authority distribution |
CN114079812A (en) * | 2020-08-21 | 2022-02-22 | 海信视像科技股份有限公司 | Display equipment and camera control method |
CN113518183A (en) * | 2021-07-23 | 2021-10-19 | 北京字节跳动网络技术有限公司 | Camera calling method and device and electronic equipment |
CN113778641A (en) * | 2021-08-09 | 2021-12-10 | 荣耀终端有限公司 | Method for controlling camera, electronic device and computer readable storage medium |
CN113377693A (en) * | 2021-08-12 | 2021-09-10 | 杭州当贝网络科技有限公司 | Control method for camera used by application program and terminal device |
CN113377693B (en) * | 2021-08-12 | 2021-11-30 | 杭州当贝网络科技有限公司 | Control method for camera used by application program and terminal device |
CN115297259A (en) * | 2022-07-27 | 2022-11-04 | 天翼云科技有限公司 | Camera management method, terminal and storage medium |
CN115297259B (en) * | 2022-07-27 | 2023-10-13 | 天翼云科技有限公司 | Camera management method, terminal and storage medium |
CN115225720A (en) * | 2022-09-20 | 2022-10-21 | 亿咖通(北京)科技有限公司 | Video stream distribution method, controller, vehicle, storage medium, and program product |
Also Published As
Publication number | Publication date |
---|---|
CN103677848B (en) | 2018-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103677848A (en) | Camera control method based on Android | |
CN1088961C (en) | Scheduling policies with grouping for providing VCR control functions in video server | |
CN103389900B (en) | A kind of control method and device that Android device camera uses | |
JP2007519103A (en) | Resource management in multiprocessor systems | |
CN104038698A (en) | Background photographing method and device | |
CN105376494B (en) | A method of multichannel USB camera is supported based on Android system | |
WO2016180189A1 (en) | Method and apparatus for accessing multimedia conference system | |
CN104834544A (en) | Data loading method and device | |
CN103763635B (en) | A kind of control method and system of video buffer | |
CN108496198A (en) | A kind of image processing method and equipment | |
CN103108232A (en) | Method and system based on interaction control of mobile phone and television | |
CN101853180A (en) | Method for realizing application management and non-intelligent mobile terminal | |
CN103414921B (en) | A kind of method for building up of distributed IPTV multi-terminal video service switchover | |
CN105389207A (en) | Adaptive data request processing method and apparatus, task scheduler and adaptive data request processing system | |
WO2008125064A1 (en) | Method, system and device for call scheduling | |
US20130216212A1 (en) | System and method of managing multiple video players executing on multiple devices | |
US8924243B2 (en) | Mitigating peak traffic times in a multimedia conference | |
CN111246154A (en) | Video call method and system | |
CN110505390A (en) | Television set and its camera call method, control device and readable storage medium storing program for executing | |
CN114286117A (en) | Multi-platform multi-application live broadcast method and system, live broadcast equipment and storage medium | |
CN106412466A (en) | Smart television system | |
CN106294188A (en) | Memory space processing method and processing device | |
CN104778041A (en) | Management method and management system for multi-program shared speech equipment | |
JP2014519631A5 (en) | ||
RU2645594C2 (en) | Method and device for traffic management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |