-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mapper supports video streaming data reporting #5514
Conversation
/kind feature |
03b3143
to
288ac8f
Compare
PTAL,thanks @luomengY @WillardHu @fisherxu |
Suggest adding a switch control parameter for starting/stopping stream data collection in the next version. |
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/stream/handler.go
Outdated
Show resolved
Hide resolved
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/stream/img.go
Outdated
Show resolved
Hide resolved
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/stream/img.go
Outdated
Show resolved
Hide resolved
// Assign appropriate parts of buffer to image planes in pFrameRGB | ||
// Note that pFrameRGB is an AVFrame, but AVFrame is a superset | ||
// of AVPicture | ||
avp := (*avcodec.Picture)(unsafe.Pointer(pFrameRGB)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider the case where type is invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand your question. Is there a problem with converting *avutil.Frame to *avcodec.Picture? The official documentation here shows that *avcodec.Picture is a superset of *avutil.Frame. You can refer to this
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/Dockerfile
Outdated
Show resolved
Hide resolved
383a8c9
to
8ac8333
Compare
Yes, we can add it with the feature about mapper supporting data writing in v1.18 |
63456d3
to
2eaf646
Compare
2990cfd
to
2ca4df0
Compare
I have made modifications according to everyone's opinions, mainly:
|
@@ -0,0 +1,33 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file necessary? The file handler_nostream.go
under stream
dir seems a bit unreasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is required, because stream.Handler needs to be called at mapper data plane capability like picture following. For mappers that do not require stream data processing, if this file is removed, an error will occur during compilation because stream.Handler cannot be found. If for name reasons, I can modify the mapper generation script and name this file to handler.go in the generated mapper project.
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/stream/handler.go
Outdated
Show resolved
Hide resolved
staging/src/github.com/kubeedge/mapper-framework/_template/mapper/data/stream/handler.go
Outdated
Show resolved
Hide resolved
./configure && make && \ | ||
make install | ||
|
||
RUN GOOS=linux go build -o main cmd/main.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to separate into two dockerfile? also cc @WillardHu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the stream mapper needs to download additional dependencies, it takes about five minutes to build the image, so I feel it would be better to separate it without affecting the construction of other mapper images.
rm "${mapperPath}/data/stream/handler.go" "${mapperPath}/data/stream/img.go" "${mapperPath}/data/stream/video.go" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If add new file for stream, this part will be hard to maintain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified it to only keep the handler_stream.go file and renamed this file to handler.go after build
a4d4410
to
ca1abb2
Compare
Signed-off-by: wbc6080 <wangbincheng4@huawei.com>
5188f3e
to
7e31103
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
Looks good for the first version.
/assign @WillardHu
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fisherxu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR implements mapper’s feature of supporting reporting of streaming data. Mainly includes the following parts:
Change the device model api definition to allow the data type of streaming data
Add the function of saving frame and saving video to the mapper-framework data processing function.
Change the logic of pushing device data in mapper-framework. When the type is streaming data, the device data is no longer pushed to the database and user applications, but processed by saving frames or saving videos.
Which issue(s) this PR fixes:
Fixes ##5401
Special notes for your reviewer:
Does this PR introduce a user-facing change?: