CN107911541A - Multi-camera switching use method and device based on Android system - Google Patents
Multi-camera switching use method and device based on Android system Download PDFInfo
- Publication number
- CN107911541A CN107911541A CN201711096584.7A CN201711096584A CN107911541A CN 107911541 A CN107911541 A CN 107911541A CN 201711096584 A CN201711096584 A CN 201711096584A CN 107911541 A CN107911541 A CN 107911541A
- Authority
- CN
- China
- Prior art keywords
- camera
- bus
- physical pathway
- concordance list
- target
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 230000037361 pathway Effects 0.000 claims description 143
- 238000012545 processing Methods 0.000 claims description 27
- 238000007792 addition Methods 0.000 claims description 17
- 238000012217 deletion Methods 0.000 claims description 17
- 230000037430 deletion Effects 0.000 claims description 17
- 238000012512 characterization method Methods 0.000 claims description 14
- 230000008859 change Effects 0.000 claims description 11
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000007547 defect Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000007812 deficiency Effects 0.000 description 3
- 238000003780 insertion Methods 0.000 description 2
- 230000037431 insertion Effects 0.000 description 2
- 235000007926 Craterellus fallax Nutrition 0.000 description 1
- 240000007175 Datura inoxia Species 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72409—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/02—Constructional features of telephone sets
- H04M1/0202—Portable telephone sets, e.g. cordless phones, mobile phones or bar type handsets
- H04M1/026—Details of the structure or mounting of specific components
- H04M1/0264—Details of the structure or mounting of specific components for a camera module assembly
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/90—Arrangement of cameras or camera modules, e.g. multiple cameras in TV studios or sports stadiums
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Computer Networks & Wireless Communication (AREA)
- Studio Devices (AREA)
Abstract
The method and the device for switching and using the multiple cameras based on the Android system can make up for the defects of the existing Android system, so that the Android device can dynamically support the multiple cameras.
Description
Technical field
This application involves computer technology, more particularly to a kind of multi-cam switching user based on android system
Method and device.
Background technology
With the prevalence of android system, more and more equipment have begun to be developed based on android system,
Such as intelligent whiteboard, Intelligent flat etc..Existing android system is based on linux kernel, to usb bus interface plug and play
Support with hot plug is very perfect.However, existing android system, only supports front and rear camera, can not support to be more than
Two cameras.But for some Android devices, user wishes that the Android device can support more than two to image
Head, to realize the demand of multi-angled shooting.For example, when Intelligent flat is applied in education and instruction, the horn of plenty content of courses,
User wishes that the Intelligent flat can support multiple cameras.However, existing Android device does not support more than two to image
Head, it is impossible to meet user demand.
The content of the invention
In view of this, the application provides a kind of multi-cam switching application method and device based on android system, with
Solve the problems, such as that Android device can not support more than two camera, using inconvenience in the prior art.
The application first aspect provides a kind of multi-cam switching application method based on android system, including:
Update physical pathway concordance list;Wherein, the physical pathway concordance list characterization current time Android device connection
The mark of camera and the physical pathway of camera between correspondence;
When there are during target camera call instruction, the physics of target camera is determined according to the physical pathway concordance list
Path;
It is the physical pathway determined by HAL layers of default access path replacement of hardware abstraction, with access target camera.
Further, the physical pathway concordance list includes application layer concordance list and HAL layer index tables, wherein, it is described to answer
There is the correspondence between the title of camera and the bus ID bus id of camera with layer index token record, it is HAL layers described
Correspondence between the bus id of concordance list characterization camera and the physical pathway of camera;The method further includes,
The title of the camera recorded in the application layer concordance list is showed into user.
Further, the renewal physical pathway concordance list, specifically includes:
Additions and deletions according to receiving change instruction and update the application layer concordance list;
The HAL layer indexs table is updated according to target camera call instruction.
Further, the additions and deletions change instruction and the target camera call instruction by user based on the shooting shown
The instruction of the title triggering of head;The physical pathway that target camera is determined according to the physical pathway concordance list, specific bag
Include:
According to the title of target camera and the application layer concordance list, the bus id of target camera are determined;
According to the bus id and the HAL layer indexs table determined, the physical pathway of target camera is determined.
Further, the renewal application layer concordance list, specifically includes:
Obtain the title of each camera of Android device current time connection and each camera
bus id;
According to the title of each camera got and the bus id of each camera, the application layer rope is updated
Draw table.
Further, the HAL layer indexs token record has between the bus id of camera and the physical pathway of camera
Correspondence;The renewal HAL layer indexs table, specifically includes:
Obtain the bus id of each camera of Android device current time connection and each camera
Physical pathway;
The physical pathway of the bus id of each camera got He the camera be recorded into the HAL layer indexs table
In.
Further, the HAL layer indexs token record has the bus id of camera, and the bus id of each camera are described
Array index number in HAL layer index tables is equal with the index value of the physical pathway of each camera;The renewal HAL layers of rope
Draw table, specifically include:
Obtain the bus id of each camera of Android device current time connection and each camera
Physical pathway;
The bus id of each camera got be recorded into array index number equal to the physical pathway of the camera
In the list item of index value.
Further, the bus id of each camera for obtaining the Android device current time connection, specifically
Including:
The configuration file of each camera is traveled through, is obtained by the soft chain of the device in the configuration file of each camera
Take the bus id of each camera.
Further, the bus id of each camera for obtaining the Android device current time connection, specifically
Including:
Check the configuration file of any one camera, obtain all bus of the Android device current time distribution
id;
The configuration file of each camera is traveled through, by point of the soft link of the video in the configuration file of each camera
Cut all bus ids of the character string one by one with Android device current time distribution to match, obtain the bus of each camera
id。
The second invention of the application provides a kind of multi-cam switching use device based on android system, including:Processing
Module and replacement module, wherein,
The processing module, for updating physical pathway concordance list, wherein, when the physical pathway concordance list characterizes current
Carve the correspondence between the mark of camera and the physical pathway of camera of Android device connection;
The processing module, is additionally operable to when there are during target camera call instruction, according to the physical pathway concordance list
Determine the physical pathway of target camera;
The replacement module, for being the physical pathway determined by HAL layers of default access path replacement of hardware abstraction, with
Access target camera.
Further, the physical pathway concordance list includes application layer concordance list and HAL layer index tables, wherein, it is described to answer
There is the correspondence between the title of camera and the bus ID bus id of camera with layer index token record, it is HAL layers described
Correspondence between the bus id of concordance list characterization camera and the physical pathway of camera;The processing module, is additionally operable to
The title of the camera recorded in the application layer concordance list is showed into user.
Further, the processing module, updates the application layer rope specifically for changing instruction according to the additions and deletions received
Draw table, and the HAL layer indexs table is updated according to target camera call instruction.
Further, the additions and deletions change instruction and the target camera call instruction by user based on the shooting shown
The instruction of the title triggering of head;The processing module, specifically for the title according to target camera and described applies layer index
Table, determines the bus id of target camera, and according to the bus id and the HAL layer indexs table determined, determines that target images
The physical pathway of head.
Further, the processing module, takes the photograph specifically for obtaining each of Android device current time connection
As the title of head and the bus id of each camera, and described take the photograph according to the title of each camera got and each
As the bus id of head, the application layer concordance list is updated.
Further, in the HAL layer indexs table there is between the bus id of camera and the physical pathway of camera record
Correspondence;The processing module, each camera connected specifically for the acquisition Android device current time
The physical pathway of bus id and each camera, and by the bus id of each camera got and the thing of the camera
Line of reasoning footpath recorded in the HAL layer indexs table.
Further, the bus id for having camera are recorded in the HAL layer indexs table, the bus id of each camera are described
Array index number in HAL layer index tables is equal with the index value of the physical pathway of each camera;The processing module is specific to use
In the bus id for each camera for obtaining the Android device current time connection and the physics road of each camera
Footpath, and the bus id of each camera got be recorded into index of the array index number equal to the physical pathway of the camera
In the list item of value.
Further, the processing module, the configuration file specifically for traveling through each camera, passes through each camera
Configuration file in the soft link of device obtain the bus id of each camera.
Further, the processing module, the configuration file specifically for checking any one camera, sets described in acquisition
All bus id of standby current time distribution;
The processing module, is additionally operable to travel through the configuration file of each camera, by the configuration file of each camera
Video soft link separating character string one by one with the equipment current time distribution all bus id match, obtain often
The bus id of a camera.
The switching application method of the multi-cam based on android system and device that the application provides, pass through more new physics
Path indexing table, and then there are during target camera call instruction, determine that target images according to above-mentioned physical pathway concordance list
The physical pathway of head, and be the physical pathway determined by HAL layers of default access path replacement.In this way, this method is based on, when
When Android device connects multiple cameras, the corresponding physical pathway of the plurality of camera can be stored in physical pathway concordance list
In, and then there are during target camera call instruction, the physics road of target camera can be determined according to physical pathway concordance list
Footpath, and be the physical pathway determined by HAL layers of default access path replacement, with access target camera, in this way, can make up existing
The deficiency of some Android systems, enables Andorid equipment to support multiple cameras, can meet user demand.In addition, this
The switching application method of the multi-cam based on android system and device that application provides, can be applied to various Android and set
Standby, versatility and portability are preferable.
Brief description of the drawings
Fig. 1 is the application scenarios signal that multi-cam of the application based on android system switches application method and device
Figure;
Fig. 2 is the flow chart that multi-cam of the application based on android system switches application method embodiment one;
Fig. 3 is the flow chart that multi-cam of the application based on android system switches application method embodiment two;
Fig. 4 is that the multi-cam based on android system shown in one exemplary embodiment of the application switches use device
The hardware architecture diagram of place terminal device;
Fig. 5 is the structure diagram that multi-cam of the application based on android system switches use device embodiment one.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects be described in detail in claims, the application.
It is only merely for the purpose of description specific embodiment in term used in this application, and is not intended to be limiting the application.
It is also intended in the application and " one kind " of singulative used in the attached claims, " described " and "the" including majority
Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein refers to and wraps
Containing the associated list items purpose of one or more, any or all may be combined.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application
A little information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, do not departing from
In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as
One information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determining ".
The application provides a kind of multi-cam switching application method and device based on android system, existing to solve
Android system does not support more than two camera, can not meet the problem of user demand in technology.
Fig. 1 is the application scenarios signal that multi-cam of the application based on android system switches application method and device
Figure.Fig. 1 is refer to, the switching application method of the multi-cam based on android system and device that the application provides, can be applied to
Run android system terminal device (i.e. Android device), for example, can be applied to run android system mobile phone,
Intelligent whiteboard, Intelligent flat etc..For example, in application scenarios shown in Fig. 1, by the application provide based on the more of android system
Camera switches application method and device and is applied in mobile phone, the mobile phone include front and rear camera (camera A in Fig. 1 and
Camera B), in addition, the mobile phone is also connected with two exterior cameras (camera C and camera D) by external interface.Please after
Continuous reference Fig. 1, when the switching application method of the multi-cam based on android system and device that provide the application are applied to figure
It when in the mobile phone shown in 1, at this time, can solve the problems, such as that Android device does not support more than two camera in the prior art, lead to
This method is crossed, mobile phone shown in Fig. 1 can support multiple cameras, and may have access to any one camera, (in Fig. 1, which can visit
Ask any one camera in four cameras).
Several specific embodiments are given below, for the technical solution of the application to be discussed in detail, below these are specific
Embodiment can be combined with each other, may be repeated no more for the same or similar concept or process in some embodiments.
Fig. 2 is the flow chart that multi-cam of the application based on android system switches application method embodiment one.This reality
The executive agent for applying example is Android device.Fig. 2 is refer to, method provided in this embodiment, can include:
S101, renewal physical pathway concordance list;Wherein, above-mentioned physical pathway concordance list characterization current time Android is set
Correspondence between the mark of camera and the physical pathway of camera of standby connection.
Exterior camera insertion has been detected first specifically, above-mentioned physical pathway concordance list can be Android device
When, created according to the configuration file of stored each camera in Android device or Android device is connecing
When receiving establishment instruction, created according to the configuration file of stored each camera in Android device.Need what is illustrated
It is that, when Android device is run, Android device can detect the camera of current time connection, generation current time connection
The configuration file of each camera (can generate the configuration text of each exterior camera of Android device current time connection
The configuration file of part and the front and rear camera of the Android device).Therefore, can have been stored according in Android device
Each camera configuration file create physical pathway concordance list.
Further, the mark of camera can be the title of camera or the bus ID bus id of camera.For example,
In one possible implementation of the application, physical pathway concordance list can only include hardware abstraction (Hardware
Abstration Layer, abbreviation HAL) layer index table, the bus ID and camera of HAL layer indexs table characterization camera
The correspondence of physical pathway.For another example in another possible implementation of the application, physical pathway concordance list includes application
Layer index table and HAL layer index tables, wherein, the token record of above application layer index has the title of camera and the bus mark of camera
Know the correspondence between bus id, the bus id of above-mentioned HAL layer indexs table characterization camera and the physical pathway of camera it
Between correspondence (embodiment shown in Figure 3, details are not described herein again).
Specifically, front and rear camera of the camera including Android device of current time Android device connection,
And the exterior camera being connected by external interface with Android device.In this step, can according in Android device
The configuration file of each camera of storage updates physical pathway concordance list (it should be noted that working as exterior camera and Android
When equipment disconnects, the corresponding configuration file of outside camera generated in Android device no longer exists accordingly),
So that the mark and camera of the camera of physical pathway concordance list characterization current time Android device connection after renewal
Correspondence between physical pathway.Specific implementation process and realization principle on updating physical pathway concordance list will be below
Embodiment be discussed in detail, details are not described herein again.
S102, when there are during target camera call instruction, target camera is determined according to above-mentioned physical pathway concordance list
Physical pathway.
It should be noted that target camera call instruction can be instruction input by user or Android is set
The instruction of standby generation.When target camera call instruction is instruction input by user, which carries
The title of target camera, at this time, physical pathway concordance list include application layer concordance list and HAL concordance lists, at this time, can be according to thing
Line of reasoning footpath concordance list determines the physical pathway of target camera.Correspondingly, when target camera call instruction is Android device
During the instruction of generation, at this time, target camera call instruction carries the bus id of target camera, at this time, physical pathway index
Table can only include HAL layer index tables, or including application layer concordance list and HAL layer index tables, to pass through physical pathway concordance list
Determine the physical pathway of target camera.
Below using the " instruction that target camera call instruction is generated as Android device, and physical pathway concordance list only wraps
Include HAL layer indexs table " exemplified by illustrate.For example, in one possible implementation of the application, Android device can lead to
Overdrive a layer algorithm, with reference to infrared perception technology determine target camera to be visited, and then generate target camera and call
Instruction (at this time, the bus id of target camera call instruction carrying target camera).For example, Android device passes through driving
Layer algorithm, it is the camera that bus id are 1-1.3 to determine target camera to be visited, and it is 1-1.3 to generate calling bus id
Camera target camera call instruction.At this time, physical pathway concordance list characterization camera bus ID bus id and
Correspondence between the physical pathway of camera.In this way, target camera can be found from physical pathway concordance list
The corresponding physical pathways of bus id, that is, determine the physical pathway of target camera.It should be noted that on driving layer algorithm
How to determine target camera to be visited, and generate the specific implementation process of target camera call instruction and realization principle can
With referring to the description of the prior art, details are not described herein again.
S103, be the physical pathway determined by HAL layers of default access path replacement of hardware abstraction, is imaged with access target
Head.
Specifically, after the physical pathway of target camera is determined, can be by HAL layers of default access path in this step
The physical pathway determined is replaced with, in this way, can access target camera.
Method provided in this embodiment, refers to by updating physical pathway concordance list, and then when being called there are target camera
When making, the physical pathway of target camera is determined according to physical pathway concordance list, and then be by HAL layers of default access path replacement
The physical pathway determined, with access target camera.In this way, this method is based on, when Android device connects multiple cameras
When, can be by the plurality of camera corresponding physical pathway deposit physical pathway concordance list, and then there are target camera tune
During with instruction, the physical pathway of target camera can be determined according to physical pathway concordance list, and HAL layers of default access path are replaced
The physical pathway determined is changed to, with access target camera, in this way, the deficiency of existing Android system can be made up, is made
Andorid equipment can dynamically support multiple cameras, can meet user demand.In addition, method provided in this embodiment, can answer
For various Android devices, versatility and portability are preferable.
A more specifically embodiment is given below, for the technical solution of the application to be discussed in detail.
Fig. 3 is the flow chart that multi-cam of the application based on android system switches application method embodiment two.This reality
Apply the whole process that example refers to multi-cam switching application method.Method provided in this embodiment, physical pathway concordance list
Including application layer concordance list and HAL layer index tables, wherein, the token record of above application layer index has the title and camera of camera
Bus ID bus id between correspondence, the bus id of above-mentioned HAL layer indexs table characterization camera and the thing of camera
Correspondence between line of reasoning footpath.Fig. 3 is refer to, method provided in this embodiment, can include:
S201, by the title of the camera recorded in above application layer index table show user.
Detected first outside it should be noted that application layer concordance list and HAL layer indexs table can be terminal devices
Created during portion's camera insertion.For example, in the application scenarios shown in Fig. 1, application layer concordance list is as shown in table 1:
Table 1
The title of camera | The bus id of camera |
A | 1-1.4.3 |
B | 1-1.5.4 |
C | 1-1.5.3 |
D | 1-1.3.1 |
In this step, the title of the camera recorded in table 1 is just showed into user, can be with for example, in one embodiment
By following content displaying to user:Camera title:Camera A, camera B, camera C, camera D.The present embodiment provides
Method, by the way that the title of the camera recorded in application layer concordance list is showed user, on the one hand, can be used family understand
The situation of the camera of Android device current time connection, on the other hand, passes through the shooting that will be recorded in application layer concordance list
The title of head shows user, it is possible to provide a human-computer interaction interface, user can be triggered based on the title of the camera shown to be increased
Revise instruction and target camera call instruction.Wherein, additions and deletions change instruction and are used to indicate that layer index is applied in Android device renewal
Table so that renewal after application layer concordance list record have current time Android device connect each camera title and
Correspondence between the bus id of above-mentioned each camera.
S202, change instruction renewal above application layer index table according to the additions and deletions received.
It should be noted that above-mentioned additions and deletions change the finger that instruction can be triggered by title of the user based on the camera shown
Order.Specifically, after the title of camera is showed user, at this time, user can be touched based on the title of the camera shown
Hair additions and deletions change instruction, when Android device, which receives additions and deletions, changes instruction, just update above application layer index table.For example, upper
In the example in face, " camera title " field for that can be shown by clicking on screen changes instruction to trigger additions and deletions.In this way, work as
When user clicks on " camera title " field shown on screen, at this time, terminal device just updates above application layer index table.
Specifically, the detailed process of renewal above application layer index table, may comprise steps of:
(1) title of each camera of Android device current time connection and the bus of above-mentioned each camera are obtained
id。
Specifically, for example, Android device current time, which is connected with five cameras, (compared to Fig. 1, newly inserts one
A exterior camera E.At this time, the configuration file of this five cameras is stored with Android device accordingly, this five shootings
Head configuration file be respectively/sys/class/video4linx/ under video0, video1, video2, video3,
Video4), in this step, the configuration file of each camera is just traveled through, is obtained by the configuration file of each camera every
The bus id of the title of a camera and above-mentioned each camera.That is under traversal/sys/class/video4linx/
Video0, video1, video2, video3, video4, the title of camera is obtained by " name " attribute.In addition, at this
Apply in a possible implementation, in this step, can by the video0 under traversal/sys/class/video4linx/,
The soft link of device in video1, video2, video3, video4, and then divided by the soft link to device
Character is cut to obtain the bus id of each camera.Specifically, for example, in one embodiment, check/sys/class/
Video0 under video4linx/, reads following content:
At this time, can by "/" and ":" soft link " ../../../1-1.3 to device:1.0 " carry out separating character,
The bus id for obtaining the camera are 1-1.3.It should be noted that due to only having in the soft link of device comprising one
The separating character string of bus id attributes, therefore, carries out separating character by the soft link to device, can directly obtain the shooting
The bus id of head.In addition, the following examples will provide another method for obtaining bus id, details are not described herein again.
(2) according to the title of each camera got and the bus id of above-mentioned each camera, above application is updated
Layer index table.
Specifically, after the bus id of the title and above-mentioned each camera that get each camera, in this step, just
According to the title of each camera got and the bus id of above-mentioned each camera, above application layer index table is updated, with
Make the title of each camera that the record of the application layer concordance list after renewal has current time terminal device to connect and above-mentioned each
Correspondence between the bus id of camera.Specifically, it is title and the shooting of any one camera for getting
The bus id of head, if the correspondence for not having record to include the title in former application layer concordance list, at this time, illustrates that the camera is
The camera being newly inserted into, at this time, just recorded application by the correspondence of the title of the camera and the bus id of the camera
In layer index table.In addition, for any bar correspondence recorded in former application layer concordance list, if being recorded in this correspondence
The title of camera be not any one title got, at this time, illustrate that the camera does not reconnect with equipment, this
When, just this correspondence in former application layer concordance list is deleted.
With reference to above example, for example, in the present embodiment, the application layer concordance list after renewal is as shown in table 2:
Table 2
The title of camera | The bus id of camera |
A | 1-1.4.3 |
B | 1-1.5.4 |
C | 1-1.5.3 |
D | 1-1.3.1 |
E | 1-1.3.2 |
S203, according to target camera call instruction update above-mentioned HAL layer indexs table.
Specifically, in the present embodiment, which can be by user based on the camera shown
The instruction of title triggering, or the instruction of Android device generation (referring to the description of embodiment one).Taken the photograph below with target
As being illustrated exemplified by instruction of the head call instruction by title triggering of the user based on the camera shown.
It should be noted that after the title of the camera recorded in application layer concordance list is showed user, and user
Title based on the camera shown is triggered after additions and deletions change instruction, at this time, the camera shown it is entitled current when
(with reference to above example, at this time, the content shown is the title of all cameras of quarter equipment connection:Camera:Camera
A, camera B, camera C, camera D, camera E), at this time, user can pass through the name of click wherein any one camera
Claim to trigger target camera call instruction, to pass through target camera call instruction selected target camera.It is for example, real one
Apply in example, at this time, user wants to call camera D, and at this time, user clicks on " camera D " the fields triggering target shown on screen
Camera call instruction.Correspondingly, when terminal device receives target camera call instruction, just it is determined that target images
Head, at this time, terminal device can update above-mentioned HAL layer indexs table according to target camera call instruction.
Further, the corresponding pass between the bus id of HAL layer indexs table characterization camera and the physical pathway of camera
System.Alternatively, the correspondence between the bus id of camera and the physical pathway of camera can be directly recorded in HAL layer indexs table
Relation.Either, only record has the bus id of camera in HAL layer indexs table, and the bus id of each camera are in above-mentioned HAL layers of rope
It is equal with the index value of the physical pathway of each camera to draw the array index number in table.When directly record has in HAL layer index tables
During correspondence between the bus id of camera and the physical pathway of camera, HAL layer indexs table can be as shown in table 3, when
When only record has the bus id of camera in HAL layer index tables, HAL layer indexs table can be as shown in table 4:
It should be noted that when in HAL layer index tables record have camera bus id and camera physical pathway it
Between correspondence when, HAL layer index tables can be updated as follows, this method may include steps of:
(1) the bus id of each camera of Android device current time connection and above-mentioned each camera are obtained
Physical pathway.
Specifically, the configuration file of each camera can be traveled through, the physical pathway of each camera is obtained, and by each
The soft link of device in the configuration file of camera obtains bus id., that is, traversal/sys/class/ of each camera
Video0, video1, video2, video3, video4 under video4linx/, obtain the physical pathway of each camera, into
And the corresponding bus id of each physical pathway are obtained by the soft link of the device under video.
In addition, in one possible implementation of the application, each physical pathway can also be obtained by the following method and is corresponded to
Bus id, this method includes:
1st, by checking the configuration file of any one camera, all bus of the said equipment current time distribution are obtained
id。
For example, in a possible implementation, by checking following configuration file:
“/sys/class/video4linux/video0/device/driver
1-1.4.3:1.0
1-1.5.4:1.0
1-1.5.3:1.0
1-1.3.1:1.1
1-1.3.2:1.1
blind
module
new_id”
All bus id for getting the distribution of the said equipment current time are 1-1.4.3,1-1.5.4,1-1.5.3,1-
1.3.1、1-1.3.2。
It should be noted that by the step, all bus of above-mentioned Android device current time distribution can be got
id.The bus id of all cameras are got, still, by this step, when getting bus id, in this case it is not apparent that bus id with
The correspondence of camera, does not know bus id and the correspondence of physical pathway yet.
2nd, the configuration file of each camera is traveled through, by the soft link of the video in the configuration file of each camera
All bus ids of the separating character string one by one with the distribution of the said equipment current time are matched, and obtain the bus id of each camera.
Specifically, video0, video1 ..., videoN under i.e. traversal sys/calss/video4linux/, and then will
Video0, video1 ..., the separating character string of the soft link of videoN are all with the distribution of the said equipment current time one by one
Bus id are matched, and obtain the corresponding bus id ... of video0, the corresponding bus id of videoN.For example, in one embodiment,
The soft link of video0 is as follows:
“/sys/class/video4linux
root...2017-07-13 16:51video0-> ../../../3-1/1-1.3:1.0/video4linux/
video0”
At this time, the soft link to video according to "/" and ":" separating character is carried out, multiple separating character strings are obtained,
In this multiple separating character string, there are multiple character strings with bus id attributes, it is thus impossible to directly determine the physical pathway
Corresponding bus id, it is necessary to by separating character string one by one with the said equipment current time distribution all bus id match, obtain
The bus id of each camera.It is specifically, for example, the separating character string of the soft link of video is current with the said equipment one by one
All bus id matchings of moment distribution, determine a matched bus id, which is video corresponding
bus id。
(2) physical pathway of the bus id of each camera got He the camera be recorded into HAL layer index tables
In.
With reference to above example, the HAL layer index tables after renewal are as shown in table 5:
Table 5
The bus id of camera | The physical pathway of camera |
1-1.4.3 | /dev/vidio0 |
1-1.3.1 | /dev/vidio3 |
1-1.5.3 | /dev/vidio2 |
1-1.5.4 | /dev/vidio1 |
1-1.3.2 | /dev/vidio4 |
It should be noted that in this step, by the bus id of each camera got and the physics of the camera
Path recorded in HAL layer index tables, can also delete the correspondence in former HAL concordance lists, so that the HAL ropes after renewal
Draw the physical pathway of the only bus id for each camera that record has equipment current time to connect and above-mentioned each camera in table
Between correspondence.
Further, when record there are the bus id of camera in HAL layer index tables, can update more by the following method
New HAL layer index tables, this method include:
(1) the bus id of each camera of the said equipment current time connection and the physics of above-mentioned each camera are obtained
Path.
The specific implementation process and realization principle of the step may refer to description above, and details are not described herein again.
(2) the bus id of each camera got be recorded into physical pathway of the array index number equal to the camera
Index value list item in.
In this step, after the bus id of each camera are got, just by the bus id of each camera got
It recorded in list item of the array index number equal to the index value of the physical pathway of the camera.With reference to above example, after renewal
HAL layer index tables it is as shown in table 6:
Table 6
1-1.4.3 |
1-1.5.4 |
1-1.5.3 |
1-1.3.1 |
1-1.3.2 |
It should be noted that if when the bus id got do not include some the bus id recorded in original HAL layer index tables,
At this time, the bus id recorded in former HAL layer indexs table can also be deleted.
S204, according to physical pathway concordance list, determine the physical pathway of target camera.
Specifically, one description in conjunction with the embodiments, when the instruction that target camera call instruction is Android device generation
When, at this time, which carries the bus id of target camera, at this time, can be directly according to HAL layer index tables
Determine the physical pathway of target camera.Further, with reference to above example, when target camera call instruction is based on institute
During the instruction of the title triggering of the camera of displaying, at this time, target camera call instruction carries the title of target camera, this
When, it according to the title and above application layer index table of target camera, can determine the bus id of target camera, then basis is true
Bus id and HAL the layer index tables made determine that the corresponding physical pathways of bus id (determine the physics road of target camera
Footpath).
With reference to above example, when user shown by clicking on screen " camera D " fields trigger target shooting
During head call instruction, at this time, for Android device according to application layer concordance list (table 2), the bus id for determining target camera are 1-
1.3.1。
Further, when the token record of HAL layer indexs has pair between the bus id of camera and the physical pathway of camera
When should be related to, at this time, by HAL layer index tables, the physical pathway of target camera can be directly obtained, for example, by table 5,
The physical pathway for getting target camera is /dev/vidio3.
In addition, when HAL layer indexs table only records the bus id of camera, and the bus id of each camera are in HAL layers of rope
It is equal with the index value of the physical pathway of each camera to draw the array index number in table.At this time, can be true by HAL layer index tables
Set the goal array indexes number of the bus id in HAL layer index tables of camera, and then determines the physical pathway of target camera
Index value, determine the physical pathway of target camera.For example, when HAL layer index tables are as shown in table 6, at this time, by looking into
Table, it may be determined that array indexes number of the bus id (1-1.3.1) of target camera in HAL layer index tables is 3, further,
The index value for determining the physical pathway of target camera is 3, and then the physical pathway of definite target camera is /dev/
vidio3。
, can should when application layer program determines the bus id of target camera it should be noted that in this step
Bus id are arranged to system property, so that HAL layers of program can obtain the bus id.
S205, be the physical pathway determined by HAL layers of default access path replacement, with access target camera.
Method provided in this embodiment, by the way that physical pathway concordance list to be arranged to include applying layer index bag and HAL layers
Concordance list, and the title of the camera recorded in application layer concordance list is showed into user, in this way, based on the camera shown
Title, user can trigger additions and deletions and changes instruction and target camera call instruction, Android device and then can be according to receiving
Additions and deletions instruction renewal application layer concordance list, and HAL layer index tables are updated according to target camera call instruction, and then according to application
Layer index table and HAL layer index tables determine the physical pathway of target camera, and are definite by HAL layers of default access path replacement
The physical pathway gone out.In this way, being based on this method, the deficiency of existing android system can be made up so that Android device energy
More than two camera is enough supported, to meet user demand.In addition.Method provided in this embodiment, the camera based on displaying
Title, user can actively select target camera to be visited, can further meet user demand.
Corresponding with the embodiment of the foregoing multi-cam switching application method based on android system, the application also carries
The multi-cam based on android system has been supplied to switch the embodiment of use device.
The embodiment of multi-cam switching use device of the application based on android system can be applied in Android
In equipment.Device embodiment can be realized by software, can also be realized by way of hardware or software and hardware combining.With soft
Exemplified by part is realized, as the device on a logical meaning, being will be non-volatile by the processor of Android device where it
Corresponding computer program instructions read what operation in memory was formed in memory.For hardware view, as shown in figure 4,
Being the application, the multi-cam based on android system switches a kind of hardware structure diagram of use device place Android device,
In addition to the processor shown in Fig. 4, memory, external interface and nonvolatile memory, in embodiment where device
Android device can also be wrapped generally according to the actual functional capability of the multi-cam switching use device based on android system
Other hardware are included, this is repeated no more.
Fig. 5 is the structure diagram that multi-cam of the application based on android system switches use device embodiment one.
The device can be realized by way of software, hardware or soft or hard combination.It refer to Fig. 5, device provided in this embodiment can be with
Including:Processing module 100 and replacement module 200, wherein,
The processing module 100, for updating physical pathway concordance list, wherein, the physical pathway concordance list characterization is worked as
Correspondence between the mark of camera and the physical pathway of camera of preceding moment Android device connection;
The processing module 100, is additionally operable to when there are during target camera call instruction, being indexed according to above-mentioned physical pathway
Table determines the physical pathway of target camera;
The replacement module 200, for being the physics road determined by hardware abstraction HAL floor default access path replacements
Footpath, with access target camera.
The device of the present embodiment, available for the technical solution for performing embodiment of the method shown in Fig. 2, its realization principle and technology
Effect is similar, and details are not described herein again.
Further, the physical pathway concordance list includes application layer concordance list and HAL layer index tables, wherein, it is described to answer
There is the correspondence between the title of camera and the bus ID bus id of camera with layer index token record, it is HAL layers described
Correspondence between the bus id of concordance list characterization camera and the physical pathway of camera;The processing module 100, is also used
In the title of the camera recorded in the application layer concordance list is showed user.
Further, the processing module 100, updates the application layer specifically for changing instruction according to the additions and deletions received
Concordance list, and the HAL layer indexs table is updated according to target camera call instruction.
Further, the additions and deletions change instruction and the target camera call instruction by user based on the shooting shown
The instruction of the title triggering of head;The processing module 100, specifically for the title according to target camera and the application layer rope
Draw table, determine the bus id of target camera, and according to the bus id and the HAL layer indexs table determined, determine that target is taken the photograph
As the physical pathway of head.
Further, the processing module 100, specifically for obtaining the every of the Android device current time connection
The bus id of the title of a camera and each camera, and according to the title of each camera got and described every
The bus id of a camera, update the application layer concordance list.
Further, in the HAL layer indexs table there is between the bus id of camera and the physical pathway of camera record
Correspondence;The processing module 100, each shooting specifically for obtaining the Android device current time connection
The physical pathway of the bus id of head and each camera, and by the bus id of each camera got and the camera
Physical pathway recorded in the HAL layer indexs table.
Further, the bus id for having camera are recorded in the HAL layer indexs table, the bus id of each camera are described
Array index number in HAL layer index tables is equal with the index value of the physical pathway of each camera;The processing module 100, tool
Body is used for the thing for the bus id and each camera for obtaining each camera of the Android device current time connection
Line of reasoning footpath, and the bus id of each camera got be recorded into array index number equal to the physical pathway of the camera
In the list item of index value.
Further, the processing module 100, the configuration file specifically for traveling through each camera, is taken the photograph by each
As head configuration file in the soft link of device obtain the bus id of each camera.
Further, the processing module 100, the configuration file specifically for checking any one camera, obtains institute
State all bus id of equipment current time distribution;
The processing module 100, is additionally operable to travel through the configuration file of each camera, by the configuration file of each camera
In video soft link separating character string one by one with the equipment current time distribution all bus id match, obtain
The bus id of each camera.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of programmed instruction is crossed to complete.Foregoing program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, execution the step of including above-mentioned each method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution described in foregoing embodiments, either to which part or all technical characteristic into
Row equivalent substitution;And these modifications or replacement, the essence of appropriate technical solution is departed from various embodiments of the present invention technology
The scope of scheme.
Claims (10)
- A kind of 1. multi-cam switching application method based on android system, it is characterised in that the described method includes:Update physical pathway concordance list;Wherein, what the physical pathway concordance list characterization current time Android device connected takes the photograph As the correspondence between the mark of head and the physical pathway of camera;When there are during target camera call instruction, the physics road of target camera is determined according to the physical pathway concordance list Footpath;It is the physical pathway determined by HAL layers of default access path replacement of hardware abstraction, with access target camera.
- 2. according to the method described in claim 1, it is characterized in that, the physical pathway concordance list include application layer concordance list and HAL layer index tables, wherein, application layer concordance list record have camera title and camera bus ID bus id it Between correspondence, the corresponding pass between the bus id of HAL layer indexs table characterization camera and the physical pathway of camera System;The method further includes,The title of the camera recorded in the application layer concordance list is showed into user.
- 3. according to the method described in claim 2, it is characterized in that, the renewal physical pathway concordance list, specifically includes:Additions and deletions according to receiving change instruction and update the application layer concordance list;The HAL layer indexs table is updated according to target camera call instruction.
- 4. according to the method described in claim 3, it is characterized in that, the additions and deletions change instruction and the target camera is called and referred to Make the instruction triggered by title of the user based on the camera shown;It is described that target is determined according to the physical pathway concordance list The physical pathway of camera, specifically includes:According to the title of target camera and the application layer concordance list, the bus id of target camera are determined;According to the bus id and the HAL layer indexs table determined, the physical pathway of target camera is determined.
- 5. according to the method described in claim 3, it is characterized in that, the renewal application layer concordance list, specifically includes:Obtain the title of each camera of the Android device current time connection and the bus of each camera id;According to the title of each camera got and the bus id of each camera, renewal is described to apply layer index Table.
- 6. according to the method described in claim 3, it is characterized in that, HAL layer indexs token record has the bus id of camera Correspondence between the physical pathway of camera;The renewal HAL layer indexs table, specifically includes:Obtain the bus id of each camera of the Android device current time connection and the physics of each camera Path;The physical pathway of the bus id of each camera got He the camera recorded in the HAL layer indexs table.
- 7. according to the method described in claim 3, it is characterized in that, HAL layer indexs token record has the bus id of camera, Array indexes number of the bus id of each camera in the HAL layer indexs table and the index value phase of the physical pathway of each camera Deng;The renewal HAL layer indexs table, specifically includes:Obtain the bus id of each camera of the Android device current time connection and the physics of each camera Path;The bus id of each camera got be recorded into index of the array index number equal to the physical pathway of the camera In the list item of value.
- 8. according to claim 5-7 any one of them methods, it is characterised in that the acquisition Android device is current The bus id of each camera of moment connection, specifically include:The configuration file of each camera is traveled through, is obtained by the soft link of the device in the configuration file of each camera every The bus id of a camera.
- 9. according to claim 5-7 any one of them methods, it is characterised in that the acquisition Android device is current The bus id of each camera of moment connection, specifically include:Check the configuration file of any one camera, obtain all bus id of the Android device current time distribution;The configuration file of each camera is traveled through, by the segmented word of the soft link of the video in the configuration file of each camera All bus ids of the symbol string one by one with Android device current time distribution are matched, and obtain the bus id of each camera.
- 10. a kind of multi-cam switching use device based on android system, it is characterised in that described device includes:Processing Module and replacement module, wherein,The processing module, for updating physical pathway concordance list, wherein, the physical pathway concordance list characterizes current time Correspondence between the mark of camera and the physical pathway of camera of Android device connection;The processing module, is additionally operable to when there are during target camera call instruction, being determined according to the physical pathway concordance list The physical pathway of target camera;The replacement module, for being the physical pathway determined by HAL layers of default access path replacement of hardware abstraction, to access Target camera.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711096584.7A CN107911541A (en) | 2017-11-09 | 2017-11-09 | Multi-camera switching use method and device based on Android system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711096584.7A CN107911541A (en) | 2017-11-09 | 2017-11-09 | Multi-camera switching use method and device based on Android system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107911541A true CN107911541A (en) | 2018-04-13 |
Family
ID=61844481
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711096584.7A Pending CN107911541A (en) | 2017-11-09 | 2017-11-09 | Multi-camera switching use method and device based on Android system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107911541A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112114906A (en) * | 2020-09-30 | 2020-12-22 | 上海商米科技集团股份有限公司 | Multi-camera application mode method based on android platform |
CN112363767A (en) * | 2020-11-11 | 2021-02-12 | 广州小鹏汽车科技有限公司 | Vehicle-mounted camera calling method and device |
CN114245012A (en) * | 2021-12-14 | 2022-03-25 | 深圳唐恩科技有限公司 | Multi-machine live broadcast switching method, system and equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130077696A (en) * | 2011-12-29 | 2013-07-09 | 전남대학교산학협력단 | Handset device having distributed interface |
CN103353835A (en) * | 2013-01-17 | 2013-10-16 | 珠海全志科技股份有限公司 | Migration processing method and device of Android system SensorHal layer compatible kinds of same Sensor devices |
CN103559150A (en) * | 2013-11-08 | 2014-02-05 | 深圳市道通科技有限公司 | Realizing method and device for external camera of host, and mobile terminal |
CN103916580A (en) * | 2012-12-31 | 2014-07-09 | 上海晨兴希姆通电子科技有限公司 | Mobile terminal of android system, and shooting method |
CN104133711A (en) * | 2014-08-07 | 2014-11-05 | 深圳市元征科技股份有限公司 | Camera safe switching method based on Android system |
CN105376494A (en) * | 2015-11-30 | 2016-03-02 | 诚迈科技(南京)股份有限公司 | Method for supporting plurality of paths of universal serial bus (USB) cameras based on Android system |
CN105955894A (en) * | 2016-04-29 | 2016-09-21 | 青岛海尔智能家电科技有限公司 | Camera external connection method for intelligent terminal, and intelligent terminal |
-
2017
- 2017-11-09 CN CN201711096584.7A patent/CN107911541A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130077696A (en) * | 2011-12-29 | 2013-07-09 | 전남대학교산학협력단 | Handset device having distributed interface |
CN103916580A (en) * | 2012-12-31 | 2014-07-09 | 上海晨兴希姆通电子科技有限公司 | Mobile terminal of android system, and shooting method |
CN103353835A (en) * | 2013-01-17 | 2013-10-16 | 珠海全志科技股份有限公司 | Migration processing method and device of Android system SensorHal layer compatible kinds of same Sensor devices |
CN103559150A (en) * | 2013-11-08 | 2014-02-05 | 深圳市道通科技有限公司 | Realizing method and device for external camera of host, and mobile terminal |
CN104133711A (en) * | 2014-08-07 | 2014-11-05 | 深圳市元征科技股份有限公司 | Camera safe switching method based on Android system |
CN105376494A (en) * | 2015-11-30 | 2016-03-02 | 诚迈科技(南京)股份有限公司 | Method for supporting plurality of paths of universal serial bus (USB) cameras based on Android system |
CN105955894A (en) * | 2016-04-29 | 2016-09-21 | 青岛海尔智能家电科技有限公司 | Camera external connection method for intelligent terminal, and intelligent terminal |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112114906A (en) * | 2020-09-30 | 2020-12-22 | 上海商米科技集团股份有限公司 | Multi-camera application mode method based on android platform |
CN112114906B (en) * | 2020-09-30 | 2024-01-30 | 上海商米科技集团股份有限公司 | Multi-camera application mode method based on android platform |
CN112363767A (en) * | 2020-11-11 | 2021-02-12 | 广州小鹏汽车科技有限公司 | Vehicle-mounted camera calling method and device |
CN114245012A (en) * | 2021-12-14 | 2022-03-25 | 深圳唐恩科技有限公司 | Multi-machine live broadcast switching method, system and equipment |
CN114245012B (en) * | 2021-12-14 | 2024-03-22 | 深圳唐恩科技有限公司 | Multi-machine live broadcast switching method, system and equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20160203134A1 (en) | Processing media items in location-based groups | |
US20140372447A1 (en) | Knowledge index system and method of providing knowledge index | |
US20080077594A1 (en) | Providing a user access to data files distributed in a plurality of different types of user devices | |
CN105426223B (en) | Using loading method and device | |
CN110162525A (en) | Read/write conflict solution, device and storage medium based on B+ tree | |
CN107911541A (en) | Multi-camera switching use method and device based on Android system | |
CN109582882A (en) | Search result shows method, apparatus and electronic equipment | |
CN106484445A (en) | The page display method of application program for mobile terminal and device | |
CN108427728A (en) | Management method, equipment and the computer-readable medium of metadata | |
CN105740454A (en) | Display method and device of picture folder and electronic equipment | |
CN105573574A (en) | Application interface navigation method and apparatus | |
CN107728983A (en) | Double screen operating method and equipment | |
CN110928397B (en) | User interface refreshing method and device, storage medium and electronic device | |
CN110286977A (en) | Display methods and Related product | |
US20180196806A1 (en) | Hashtag-playlist content sequence management | |
CN109491962A (en) | A kind of file directory tree management method and relevant apparatus | |
CN109241323A (en) | The method for generating user's poster is commented on based on e-book and calculates equipment | |
WO2020119253A1 (en) | Page index, address book, client, and data processing method and apparatus | |
CN105554424A (en) | Method and apparatus for video playing in application | |
CN108595965A (en) | Prevent the method and its device that the attribute information of interface control is stolen | |
CN107193754A (en) | Carry out the method and apparatus that data storage is used to search for | |
CN114979743A (en) | Method, device, equipment and medium for displaying audiovisual works | |
CN107423047A (en) | Application icon display method and related equipment | |
KR101589969B1 (en) | File management method and system of network structure | |
CN106331335A (en) | Image data processing method and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180413 |